From b8e83ca03fb8d652b8160419d9f1d07384f6f3e5 Mon Sep 17 00:00:00 2001 From: tron Date: Sun, 5 Dec 2004 12:43:04 +0000 Subject: (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. --- economy.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'economy.c') diff --git a/economy.c b/economy.c index 1e443cdc9..9fa35e5c4 100644 --- a/economy.c +++ b/economy.c @@ -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; -- cgit v1.2.3-54-g00ecf