summaryrefslogtreecommitdiff
path: root/aircraft_cmd.c
diff options
context:
space:
mode:
authorpeter1138 <peter1138@openttd.org>2005-11-26 16:41:14 +0000
committerpeter1138 <peter1138@openttd.org>2005-11-26 16:41:14 +0000
commit87f54ebf92725c36c4ab0aa1b97fe9152e7db5c1 (patch)
treeccd73fcd302984e4abaf2d806bf28bf73a54e79f /aircraft_cmd.c
parent9a381f4d5d7a575571943b94c94c27b3ae6cad2d (diff)
downloadopenttd-87f54ebf92725c36c4ab0aa1b97fe9152e7db5c1.tar.xz
(svn r3239) - Codechange: Introduce and use helper functions for engine replacement code.
Diffstat (limited to 'aircraft_cmd.c')
-rw-r--r--aircraft_cmd.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/aircraft_cmd.c b/aircraft_cmd.c
index c30cf1a5d..eaeeb0c84 100644
--- a/aircraft_cmd.c
+++ b/aircraft_cmd.c
@@ -1469,7 +1469,7 @@ static void AircraftEventHandler_HeliTakeOff(Vehicle *v, const AirportFTAClass *
// check if the aircraft needs to be replaced or renewed and send it to a hangar if needed
if (v->owner == _local_player && (
- p->engine_replacement[v->engine_type] != INVALID_ENGINE ||
+ EngineHasReplacement(p, v->engine_type) ||
(p->engine_renew && v->age - v->max_age > p->engine_renew_months * 30)
)) {
_current_player = _local_player;
@@ -1533,7 +1533,7 @@ static void AircraftEventHandler_Landing(Vehicle *v, const AirportFTAClass *Airp
// check if the aircraft needs to be replaced or renewed and send it to a hangar if needed
if (v->current_order.type != OT_GOTO_DEPOT && v->owner == _local_player) {
// only the vehicle owner needs to calculate the rest (locally)
- if ((p->engine_replacement[v->engine_type] != INVALID_ENGINE) ||
+ if (EngineHasReplacement(p, v->engine_type) ||
(p->engine_renew && v->age - v->max_age > (p->engine_renew_months * 30))) {
// send the aircraft to the hangar at next airport (bit 17 set)
_current_player = _local_player;