From c882248348510265e1926b0abc031b4c6fb0f97f Mon Sep 17 00:00:00 2001 From: rubidium Date: Fri, 22 May 2009 20:07:26 +0000 Subject: (svn r16388) -Codechange: move u.air to Aircraft --- src/vehicle.cpp | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) (limited to 'src/vehicle.cpp') diff --git a/src/vehicle.cpp b/src/vehicle.cpp index 28d026feb..857c4df8a 100644 --- a/src/vehicle.cpp +++ b/src/vehicle.cpp @@ -530,7 +530,7 @@ void Vehicle::PreDestructor() Station *st = GetTargetAirportIfValid(a); if (st != NULL) { const AirportFTA *layout = st->Airport()->layout; - CLRBITS(st->airport_flags, layout[this->u.air.previous_pos].block | layout[this->u.air.pos].block); + CLRBITS(st->airport_flags, layout[a->previous_pos].block | layout[a->pos].block); } } @@ -1571,10 +1571,13 @@ CommandCost Vehicle::SendToDepot(DoCommandFlag flags, DepotCommand command) /* If there is no depot in front, reverse automatically (trains only) */ if (this->type == VEH_TRAIN && reverse) DoCommand(this->tile, this->index, 0, DC_EXEC, CMD_REVERSE_TRAIN_DIRECTION); - if (this->type == VEH_AIRCRAFT && this->u.air.state == FLYING && this->u.air.targetairport != destination) { - /* The aircraft is now heading for a different hangar than the next in the orders */ - extern void AircraftNextAirportPos_and_Order(Aircraft *a); - AircraftNextAirportPos_and_Order((Aircraft *)this); + if (this->type == VEH_AIRCRAFT) { + Aircraft *a = (Aircraft *)this; + if (a->state == FLYING && a->targetairport != destination) { + /* The aircraft is now heading for a different hangar than the next in the orders */ + extern void AircraftNextAirportPos_and_Order(Aircraft *a); + AircraftNextAirportPos_and_Order(a); + } } } -- cgit v1.2.3-54-g00ecf