summaryrefslogtreecommitdiff
path: root/station_cmd.c
diff options
context:
space:
mode:
authortron <tron@openttd.org>2004-12-05 12:43:04 +0000
committertron <tron@openttd.org>2004-12-05 12:43:04 +0000
commit7c2448ecea6ec47f9df4928ad3f42668936835ee (patch)
treef4ed902f473744cc8497d09b3f372d3da1524f4f /station_cmd.c
parent1de8e294d892a70edbd1f4f3d3a6a141711f6648 (diff)
downloadopenttd-7c2448ecea6ec47f9df4928ad3f42668936835ee.tar.xz
(svn r955) Replace uint16 for orders with struct Order
This adds no functionality, but is a stepping stone for future improvement (like 16bit order indices) and is easier to read. This changes preserves binary compatibility wrt savegames.
Diffstat (limited to 'station_cmd.c')
-rw-r--r--station_cmd.c14
1 files changed, 10 insertions, 4 deletions
diff --git a/station_cmd.c b/station_cmd.c
index 420520a78..57fa3c4ea 100644
--- a/station_cmd.c
+++ b/station_cmd.c
@@ -2139,10 +2139,12 @@ static uint32 VehicleEnter_Station(Vehicle *v, uint tile, int x, int y)
!IsTrainStationTile(tile + _tileoffs_by_dir[v->direction >> 1])) {
station_id = _map2[tile];
- if ((!(v->next_order & OF_NON_STOP) && !_patches.new_nonstop) ||
- (((v->next_order & OT_MASK) == OT_GOTO_STATION && v->next_order_param == station_id))) {
+ if ((!(v->current_order.flags & OF_NON_STOP) && !_patches.new_nonstop) ||
+ (v->current_order.type == OT_GOTO_STATION && v->current_order.station == station_id)) {
- if (!(_patches.new_nonstop && (v->next_order & OF_NON_STOP)) && v->next_order != OT_LEAVESTATION && v->last_station_visited != station_id) {
+ if (!(_patches.new_nonstop && v->current_order.flags & OF_NON_STOP) &&
+ v->current_order.type != OT_LEAVESTATION &&
+ v->last_station_visited != station_id) {
x &= 0xF;
y &= 0xF;
@@ -2199,6 +2201,7 @@ static uint32 VehicleEnter_Station(Vehicle *v, uint tile, int x, int y)
static void DeleteStation(Station *st)
{
+ Order order;
int index;
st->xy = 0;
@@ -2209,7 +2212,10 @@ static void DeleteStation(Station *st)
index = st->index;
DeleteWindowById(WC_STATION_VIEW, index);
- DeleteCommandFromVehicleSchedule((index << 8) + OT_GOTO_STATION);
+ order.type = OT_GOTO_STATION;
+ order.flags = 0;
+ order.station = index;
+ DeleteCommandFromVehicleSchedule(order);
DeleteSubsidyWithStation(index);
}