summaryrefslogtreecommitdiff
path: root/ship_cmd.c
diff options
context:
space:
mode:
authortruelight <truelight@openttd.org>2006-08-26 16:34:03 +0000
committertruelight <truelight@openttd.org>2006-08-26 16:34:03 +0000
commitdb8dfcd6e90f13ed0aafec06fc5975967afb1bb5 (patch)
tree7f558c2b1487df44a464aa980693e44cb438c592 /ship_cmd.c
parentf73a2829f364b07d6f944b8b49e156b9774db39b (diff)
downloadopenttd-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 'ship_cmd.c')
-rw-r--r--ship_cmd.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/ship_cmd.c b/ship_cmd.c
index 367742802..4fceb3da3 100644
--- a/ship_cmd.c
+++ b/ship_cmd.c
@@ -125,7 +125,7 @@ static void CheckIfShipNeedsService(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);
}
@@ -229,7 +229,7 @@ static void ProcessShipOrder(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;
v->current_order = *order;
@@ -237,15 +237,15 @@ static void ProcessShipOrder(Vehicle *v)
if (order->type == OT_GOTO_STATION) {
const Station *st;
- if (order->station == v->last_station_visited)
+ if (order->dest.station == v->last_station_visited)
v->last_station_visited = INVALID_STATION;
- st = GetStation(order->station);
+ st = GetStation(order->dest.station);
if (st->dock_tile != 0) {
v->dest_tile = TILE_ADD(st->dock_tile, ToTileIndexDiff(GetDockOffset(st->dock_tile)));
}
} else if (order->type == OT_GOTO_DEPOT) {
- v->dest_tile = GetDepot(order->station)->xy;
+ v->dest_tile = GetDepot(order->dest.depot)->xy;
} else {
v->dest_tile = 0;
}
@@ -722,10 +722,10 @@ static void ShipController(Vehicle *v)
} else if (v->current_order.type == OT_GOTO_STATION) {
Station *st;
- v->last_station_visited = v->current_order.station;
+ v->last_station_visited = v->current_order.dest.station;
/* Process station in the orderlist. */
- st = GetStation(v->current_order.station);
+ st = GetStation(v->current_order.dest.station);
if (st->facilities & FACIL_DOCK) { /* ugly, ugly workaround for problem with ships able to drop off cargo at wrong stations */
v->current_order.type = OT_LOADING;
v->current_order.flags &= OF_FULL_LOAD | OF_UNLOAD | OF_TRANSFER;
@@ -1033,7 +1033,7 @@ int32 CmdSendShipToDepot(TileIndex tile, uint32 flags, uint32 p1, uint32 p2)
v->dest_tile = dep->xy;
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;
InvalidateWindowWidget(WC_VEHICLE_VIEW, v->index, STATUS_BAR);
}