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 /roadveh_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 'roadveh_cmd.c')
-rw-r--r-- | roadveh_cmd.c | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/roadveh_cmd.c b/roadveh_cmd.c index 42562ee1f..406c55269 100644 --- a/roadveh_cmd.c +++ b/roadveh_cmd.c @@ -394,7 +394,7 @@ int32 CmdSendRoadVehToDepot(TileIndex tile, uint32 flags, uint32 p1, uint32 p2) ClearSlot(v); v->current_order.type = OT_GOTO_DEPOT; v->current_order.flags = OF_NON_STOP | OF_HALT_IN_DEPOT; - v->current_order.station = dep->index; + v->current_order.dest.depot = dep->index; v->dest_tile = dep->xy; InvalidateWindowWidget(WC_VEHICLE_VIEW, v->index, STATUS_BAR); } @@ -649,7 +649,7 @@ static void ProcessRoadVehOrder(Vehicle *v) if (order->type == v->current_order.type && order->flags == v->current_order.flags && - order->station == v->current_order.station) { + order->dest.station == v->current_order.dest.station) { return; } @@ -659,12 +659,12 @@ static void ProcessRoadVehOrder(Vehicle *v) case OT_GOTO_STATION: { const RoadStop* rs; - if (order->station == v->last_station_visited) { + if (order->dest.station == v->last_station_visited) { v->last_station_visited = INVALID_STATION; } rs = GetPrimaryRoadStop( - GetStation(order->station), + GetStation(order->dest.station), v->cargo_type == CT_PASSENGERS ? RS_BUS : RS_TRUCK ); @@ -690,7 +690,7 @@ static void ProcessRoadVehOrder(Vehicle *v) } case OT_GOTO_DEPOT: - v->dest_tile = GetDepot(order->station)->xy; + v->dest_tile = GetDepot(order->dest.depot)->xy; break; default: @@ -1478,7 +1478,7 @@ again: 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; } @@ -1520,9 +1520,9 @@ again: if (v->current_order.type != OT_GOTO_STATION) { DEBUG(ms, 0) ("Multistop: -- Current order type (%d) is not OT_GOTO_STATION.", v->current_order.type); } else { - if (v->current_order.station != st->index) + if (v->current_order.dest.station != st->index) DEBUG(ms, 0) ("Multistop: -- Current station %d is not target station in current_order.station (%d).", - st->index, v->current_order.station); + st->index, v->current_order.dest.station); } DEBUG(ms, 0) (" -- Force a slot clearing."); @@ -1637,7 +1637,7 @@ static void CheckIfRoadVehNeedsService(Vehicle *v) v->current_order.type = OT_GOTO_DEPOT; v->current_order.flags = OF_NON_STOP; - v->current_order.station = depot->index; + v->current_order.dest.depot = depot->index; v->dest_tile = depot->xy; InvalidateWindowWidget(WC_VEHICLE_VIEW, v->index, STATUS_BAR); } @@ -1665,7 +1665,7 @@ void OnNewDay_RoadVeh(Vehicle *v) /* update destination */ if (v->current_order.type == OT_GOTO_STATION && v->u.road.slot == NULL && !(v->vehstatus & VS_CRASHED)) { - Station* st = GetStation(v->current_order.station); + Station* st = GetStation(v->current_order.dest.station); RoadStop* rs = GetPrimaryRoadStop(st, v->cargo_type == CT_PASSENGERS ? RS_BUS : RS_TRUCK); RoadStop* best = NULL; |