From 916e217cfcd05367ca30f2f99e5be72527d523c3 Mon Sep 17 00:00:00 2001 From: cirdan Date: Tue, 12 Sep 2017 18:01:18 +0200 Subject: [PATCH] Inline AirportGoToNextPosition Inline AirportGoToNextPosition at its only call site. --- src/aircraft_cmd.cpp | 20 ++++++++------------ 1 file changed, 8 insertions(+), 12 deletions(-) diff --git a/src/aircraft_cmd.cpp b/src/aircraft_cmd.cpp index 3e34ad41b..434160c44 100644 --- a/src/aircraft_cmd.cpp +++ b/src/aircraft_cmd.cpp @@ -1695,17 +1695,6 @@ static void AirportClearBlock(const Aircraft *v, const AirportFTAClass *apc) } } -static void AirportGoToNextPosition(Aircraft *v) -{ - /* if aircraft is not in position, wait until it is */ - if (!AircraftController(v)) return; - - const AirportFTAClass *apc = Station::Get(v->targetairport)->airport.GetFTA(); - - AirportClearBlock(v, apc); - AirportMove(v, apc); // move aircraft to next position -} - /* gets pos from vehicle and next orders */ static bool AirportMove(Aircraft *v, const AirportFTAClass *apc) { @@ -1942,7 +1931,14 @@ static bool AircraftEventHandler(Aircraft *v, int loop) } } - if (!HasBit(v->flags, VAF_DEST_TOO_FAR)) AirportGoToNextPosition(v); + /* If aircraft is not in position, wait until it is. */ + if (!HasBit(v->flags, VAF_DEST_TOO_FAR) && AircraftController (v)) { + Station *st = Station::Get (v->targetairport); + const AirportFTAClass *apc = st->airport.GetFTA(); + + AirportClearBlock (v, apc); + AirportMove (v, apc); // move aircraft to next position + } return true; } -- 2.11.4.GIT