diff options
author | rubidium <rubidium@openttd.org> | 2007-08-30 13:03:56 +0000 |
---|---|---|
committer | rubidium <rubidium@openttd.org> | 2007-08-30 13:03:56 +0000 |
commit | cb7eaff3534c1d18c9c8bc06be04ceb437d97765 (patch) | |
tree | 141633b357757cb790c904dc033f8479d58ba5e5 /src/economy.cpp | |
parent | ac5fde61fb03059daee4b505dcaad84f21b93857 (diff) | |
download | openttd-cb7eaff3534c1d18c9c8bc06be04ceb437d97765.tar.xz |
(svn r11003) -Codechange: replace Vehicle->next to Vehicle->Next() and Vehicle->SetNext() so we can trap instances that change a next pointer and (in the future) update the first/previous pointers based on that.
Diffstat (limited to 'src/economy.cpp')
-rw-r--r-- | src/economy.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/economy.cpp b/src/economy.cpp index 2a42a13c7..f120feb55 100644 --- a/src/economy.cpp +++ b/src/economy.cpp @@ -1412,7 +1412,7 @@ void VehiclePayment(Vehicle *front_v) /* Start unloading in at the first possible moment */ front_v->load_unload_time_rem = 1; - for (Vehicle *v = front_v; v != NULL; v = v->next) { + for (Vehicle *v = front_v; v != NULL; v = v->Next()) { /* No cargo to unload */ if (v->cargo_cap == 0 || v->cargo.Empty()) continue; @@ -1499,7 +1499,7 @@ static void LoadUnloadVehicle(Vehicle *v, int *cargo_left) if (--v->load_unload_time_rem != 0) { if (_patches.improved_load && HASBIT(v->current_order.flags, OFB_FULL_LOAD)) { /* 'Reserve' this cargo for this vehicle, because we were first. */ - for (; v != NULL; v = v->next) { + for (; v != NULL; v = v->Next()) { if (v->cargo_cap != 0) cargo_left[v->cargo_type] -= v->cargo_cap - v->cargo.Count(); } } @@ -1529,7 +1529,7 @@ static void LoadUnloadVehicle(Vehicle *v, int *cargo_left) StationID last_visited = v->last_station_visited; Station *st = GetStation(last_visited); - for (; v != NULL; v = v->next) { + for (; v != NULL; v = v->Next()) { if (v->cargo_cap == 0) continue; byte load_amount = EngInfo(v->engine_type)->load_amount; @@ -1651,7 +1651,7 @@ static void LoadUnloadVehicle(Vehicle *v, int *cargo_left) * enough to fill the previous wagons) */ if (_patches.improved_load && HASBIT(u->current_order.flags, OFB_FULL_LOAD)) { /* Update left cargo */ - for (v = u; v != NULL; v = v->next) { + for (v = u; v != NULL; v = v->Next()) { if (v->cargo_cap != 0) cargo_left[v->cargo_type] -= v->cargo_cap - v->cargo.Count(); } } |