Skip to content

Commit

Permalink
Codechange: Iterate road vehicle group lists for InitializeWindowsAnd…
Browse files Browse the repository at this point in the history
…Caches
  • Loading branch information
SamuXarick committed Jan 3, 2024
1 parent 8655295 commit 87c0391
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/saveload/afterload.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -289,8 +289,11 @@ static void InitializeWindowsAndCaches()
it->tile = t->xy;
}
}
for (RoadVehicle *rv : RoadVehicle::Iterate()) {
if (rv->IsFrontEngine()) {

for (const Company *c : Company::Iterate()) {
const VehicleList &vehicle_list = c->group_all[VEH_ROAD].vehicle_list;
for (const Vehicle *v : vehicle_list) {
RoadVehicle *rv = RoadVehicle::From(Vehicle::Get(v->index));
rv->CargoChanged();
}
}
Expand Down

0 comments on commit 87c0391

Please sign in to comment.