diff options
author | tron <tron@openttd.org> | 2004-12-05 12:43:04 +0000 |
---|---|---|
committer | tron <tron@openttd.org> | 2004-12-05 12:43:04 +0000 |
commit | 7c2448ecea6ec47f9df4928ad3f42668936835ee (patch) | |
tree | f4ed902f473744cc8497d09b3f372d3da1524f4f /economy.c | |
parent | 1de8e294d892a70edbd1f4f3d3a6a141711f6648 (diff) | |
download | openttd-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 'economy.c')
-rw-r--r-- | economy.c | 10 |
1 files changed, 5 insertions, 5 deletions
@@ -1231,7 +1231,7 @@ static bool LoadWait(const Vehicle *v, const Vehicle *u) { const Vehicle *x; bool has_any_cargo = false; - if (!(u->next_order & OF_FULL_LOAD)) return false; + if (!(u->current_order.flags & OF_FULL_LOAD)) return false; for (w = u; w != NULL; w = w->next) { if (w->cargo_count != 0) { @@ -1246,7 +1246,7 @@ static bool LoadWait(const Vehicle *v, const Vehicle *u) { if ((x->type != VEH_Train || x->subtype == 0) && // for all locs u->last_station_visited == x->last_station_visited && // at the same station !(x->vehstatus & VS_STOPPED) && // not stopped - (x->next_order & OT_MASK) == OT_LOADING && // loading + x->current_order.type == OT_LOADING && // loading u != x) { // not itself bool other_has_any_cargo = false; bool has_space_for_same_type = false; @@ -1288,7 +1288,7 @@ int LoadUnloadVehicle(Vehicle *v) byte old_player; bool completely_empty = true; - assert((v->next_order&0x1F) == OT_LOADING); + assert(v->current_order.type == OT_LOADING); v->cur_speed = 0; old_player = _current_player; @@ -1309,7 +1309,7 @@ int LoadUnloadVehicle(Vehicle *v) profit += DeliverGoods(v->cargo_count, v->cargo_type, v->cargo_source, last_visited, v->cargo_days); result |= 1; v->cargo_count = 0; - } else if (u->next_order & OF_UNLOAD) { + } else if (u->current_order.flags & OF_UNLOAD) { /* unload goods and let it wait at the station */ st->time_since_unload = 0; @@ -1335,7 +1335,7 @@ int LoadUnloadVehicle(Vehicle *v) } /* don't pick up goods that we unloaded */ - if (u->next_order & OF_UNLOAD) continue; + if (u->current_order.flags & OF_UNLOAD) continue; /* update stats */ ge->days_since_pickup = 0; |