diff options
author | truelight <truelight@openttd.org> | 2006-08-26 16:34:03 +0000 |
---|---|---|
committer | truelight <truelight@openttd.org> | 2006-08-26 16:34:03 +0000 |
commit | db8dfcd6e90f13ed0aafec06fc5975967afb1bb5 (patch) | |
tree | 7f558c2b1487df44a464aa980693e44cb438c592 /aircraft_cmd.c | |
parent | f73a2829f364b07d6f944b8b49e156b9774db39b (diff) | |
download | openttd-db8dfcd6e90f13ed0aafec06fc5975967afb1bb5.tar.xz |
(svn r6142) -Codechange: added WaypointID (sorry DV, couldn't splits it anymore)
-Codechange: introduced DestinationID, which is in fact an union of several types
Used in Order struct, so no longer StationID is abused for all targets.
Hangars are a big exception, as they use a station-id with GOTO_DEPOT (go figure)
Diffstat (limited to 'aircraft_cmd.c')
-rw-r--r-- | aircraft_cmd.c | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/aircraft_cmd.c b/aircraft_cmd.c index 6dd814da0..ba4a64cea 100644 --- a/aircraft_cmd.c +++ b/aircraft_cmd.c @@ -537,7 +537,7 @@ int32 CmdSendAircraftToHangar(TileIndex tile, uint32 flags, uint32 p1, uint32 p2 if (flags & DC_EXEC) { v->current_order.type = OT_GOTO_DEPOT; v->current_order.flags = HASBIT(p2, 16) ? 0 : OF_NON_STOP | OF_FULL_LOAD; - v->current_order.station = next_airport_index; + v->current_order.dest.station = next_airport_index; InvalidateWindowWidget(WC_VEHICLE_VIEW, v->index, STATUS_BAR); if (HASBIT(p2, 17) || (p2 == 0 && v->u.air.state == FLYING && !next_airport_has_hangar)) { // the aircraft is now heading for a different hangar than the next in the orders @@ -650,7 +650,7 @@ static void CheckIfAircraftNeedsService(Vehicle *v) if (_patches.gotodepot && VehicleHasDepotOrders(v)) return; - st = GetStation(v->current_order.station); + st = GetStation(v->current_order.dest.station); // only goto depot if the target airport has terminals (eg. it is airport) if (IsValidStation(st) && st->airport_tile != 0 && GetAirport(st->airport_type)->terminals != NULL) { // printf("targetairport = %d, st->index = %d\n", v->u.air.targetairport, st->index); @@ -1195,9 +1195,9 @@ static void ProcessAircraftOrder(Vehicle *v) if (order->type == OT_DUMMY && !CheckForValidOrders(v)) CrashAirplane(v); - if (order->type == v->current_order.type && - order->flags == v->current_order.flags && - order->station == v->current_order.station) + if (order->type == v->current_order.type && + order->flags == v->current_order.flags && + order->dest.station == v->current_order.dest.station) return; v->current_order = *order; @@ -1205,7 +1205,7 @@ static void ProcessAircraftOrder(Vehicle *v) // orders are changed in flight, ensure going to the right station if (order->type == OT_GOTO_STATION && v->u.air.state == FLYING) { AircraftNextAirportPos_and_Order(v); - v->u.air.targetairport = order->station; + v->u.air.targetairport = order->dest.station; } InvalidateVehicleOrder(v); @@ -1347,7 +1347,7 @@ static void AircraftEntersTerminal(Vehicle *v) v->current_order.flags = 0; if (old_order.type == OT_GOTO_STATION && - v->current_order.station == v->last_station_visited) { + v->current_order.dest.station == v->last_station_visited) { v->current_order.flags = (old_order.flags & (OF_FULL_LOAD | OF_UNLOAD | OF_TRANSFER)) | OF_NON_STOP; } @@ -1415,7 +1415,7 @@ static void AircraftNextAirportPos_and_Order(Vehicle *v) if (v->current_order.type == OT_GOTO_STATION || v->current_order.type == OT_GOTO_DEPOT) - v->u.air.targetairport = v->current_order.station; + v->u.air.targetairport = v->current_order.dest.station; st = GetStation(v->u.air.targetairport); Airport = GetAirport(st->airport_type); @@ -1487,7 +1487,7 @@ static void AircraftEventHandler_InHangar(Vehicle *v, const AirportFTAClass *Air if (AirportHasBlock(v, &Airport->layout[v->u.air.pos], Airport)) return; // We are already at the target airport, we need to find a terminal - if (v->current_order.station == v->u.air.targetairport) { + if (v->current_order.dest.station == v->u.air.targetairport) { // FindFreeTerminal: // 1. Find a free terminal, 2. Occupy it, 3. Set the vehicle's state to that terminal if (v->subtype != 0) { @@ -1539,7 +1539,7 @@ static void AircraftEventHandler_AtTerminal(Vehicle *v, const AirportFTAClass *A v->u.air.state = (v->subtype != 0) ? TAKEOFF : HELITAKEOFF; break; case OT_GOTO_DEPOT: // visit hangar for serivicing, sale, etc. - if (v->current_order.station == v->u.air.targetairport) { + if (v->current_order.dest.station == v->u.air.targetairport) { v->u.air.state = HANGAR; } else { v->u.air.state = (v->subtype != 0) ? TAKEOFF : HELITAKEOFF; |