diff options
author | rubidium <rubidium@openttd.org> | 2009-05-22 20:07:26 +0000 |
---|---|---|
committer | rubidium <rubidium@openttd.org> | 2009-05-22 20:07:26 +0000 |
commit | c882248348510265e1926b0abc031b4c6fb0f97f (patch) | |
tree | e2e97af6a402e4babea7d19de728a50ead416f51 /src/vehicle.cpp | |
parent | ada30679605644a228be26850a76370fea723799 (diff) | |
download | openttd-c882248348510265e1926b0abc031b4c6fb0f97f.tar.xz |
(svn r16388) -Codechange: move u.air to Aircraft
Diffstat (limited to 'src/vehicle.cpp')
-rw-r--r-- | src/vehicle.cpp | 13 |
1 files changed, 8 insertions, 5 deletions
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); + } } } |