summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authortron <tron@openttd.org>2007-02-21 19:49:18 +0000
committertron <tron@openttd.org>2007-02-21 19:49:18 +0000
commitb3d93e3aa22e7a00009a4b19d64b430e3693027d (patch)
tree0f7b07cf2a66d70ba6c5835ecf73d666a5df27e0
parentf716c0b30ffb5db1ad81a9015f03cb07fb4c9351 (diff)
downloadopenttd-b3d93e3aa22e7a00009a4b19d64b430e3693027d.tar.xz
(svn r8834) -Fix
Do not pass something to a function it better could figure out by itself
-rw-r--r--src/aircraft_cmd.cpp7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/aircraft_cmd.cpp b/src/aircraft_cmd.cpp
index eabc6504e..32743f75e 100644
--- a/src/aircraft_cmd.cpp
+++ b/src/aircraft_cmd.cpp
@@ -38,7 +38,6 @@ static bool AirportSetBlocks(Vehicle *v, const AirportFTA *current_pos, const Ai
static bool AirportHasBlock(Vehicle *v, const AirportFTA *current_pos, const AirportFTAClass *apc);
static bool AirportFindFreeTerminal(Vehicle *v, const AirportFTAClass *apc);
static bool AirportFindFreeHelipad(Vehicle *v, const AirportFTAClass *apc);
-static void AirportGoToNextPosition(Vehicle *v, const AirportFTAClass *apc);
static void CrashAirplane(Vehicle *v);
static void AircraftNextAirportPos_and_Order(Vehicle *v);
@@ -1738,11 +1737,13 @@ static void AirportClearBlock(const Vehicle *v, const AirportFTAClass *apc)
}
}
-static void AirportGoToNextPosition(Vehicle *v, const AirportFTAClass *apc)
+static void AirportGoToNextPosition(Vehicle *v)
{
// if aircraft is not in position, wait until it is
if (!AircraftController(v)) return;
+ const AirportFTAClass *apc = GetStation(v->u.air.targetairport)->Airport();
+
AirportClearBlock(v, apc);
AirportMove(v, apc); // move aircraft to next position
}
@@ -2006,7 +2007,7 @@ static void AircraftEventHandler(Vehicle *v, int loop)
if (v->current_order.type >= OT_LOADING) return;
- AirportGoToNextPosition(v, GetStation(v->u.air.targetairport)->Airport());
+ AirportGoToNextPosition(v);
}
void Aircraft_Tick(Vehicle *v)