summaryrefslogtreecommitdiff
path: root/ship_cmd.c
diff options
context:
space:
mode:
authortron <tron@openttd.org>2006-09-03 08:25:27 +0000
committertron <tron@openttd.org>2006-09-03 08:25:27 +0000
commit1c21c645ae04601cd3711b37e6541d807cb727a7 (patch)
tree79ebec494a87cd0b8e16e577740868f5bf90a7d2 /ship_cmd.c
parent302772883ce9dd965ca6dfe9ade85530c6de8210 (diff)
downloadopenttd-1c21c645ae04601cd3711b37e6541d807cb727a7.tar.xz
(svn r6353) -Codechange: Make DestinationID a typedef of uin16, which is as large as any type of destinataion (StationID, DepotID, WaypointID) it can hold
DestinationID being a union of these types is just hassle without benefit and cannot be handled correctly everywhere because of local lack of information
Diffstat (limited to 'ship_cmd.c')
-rw-r--r--ship_cmd.c20
1 files changed, 10 insertions, 10 deletions
diff --git a/ship_cmd.c b/ship_cmd.c
index 68ce0073a..16d3fa623 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.dest.depot = depot->index;
+ v->current_order.dest = depot->index;
v->dest_tile = depot->xy;
InvalidateWindowWidget(WC_VEHICLE_VIEW, v->index, STATUS_BAR);
}
@@ -227,9 +227,9 @@ static void ProcessShipOrder(Vehicle *v)
return;
}
- if (order->type == v->current_order.type &&
- order->flags == v->current_order.flags &&
- order->dest.station == v->current_order.dest.station)
+ if (order->type == v->current_order.type &&
+ order->flags == v->current_order.flags &&
+ order->dest == v->current_order.dest)
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->dest.station == v->last_station_visited)
+ if (order->dest == v->last_station_visited)
v->last_station_visited = INVALID_STATION;
- st = GetStation(order->dest.station);
+ st = GetStation(order->dest);
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->dest.depot)->xy;
+ v->dest_tile = GetDepot(order->dest)->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.dest.station;
+ v->last_station_visited = v->current_order.dest;
/* Process station in the orderlist. */
- st = GetStation(v->current_order.dest.station);
+ st = GetStation(v->current_order.dest);
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;
@@ -1055,7 +1055,7 @@ int32 CmdSendShipToDepot(TileIndex tile, uint32 flags, uint32 p1, uint32 p2)
v->current_order.type = OT_GOTO_DEPOT;
v->current_order.flags = OF_NON_STOP;
if (!(p2 & DEPOT_SERVICE)) SETBIT(v->current_order.flags, OFB_HALT_IN_DEPOT);
- v->current_order.dest.depot = dep->index;
+ v->current_order.dest = dep->index;
InvalidateWindowWidget(WC_VEHICLE_VIEW, v->index, STATUS_BAR);
}