1
0
Fork 0

Codechange: Iterate train group lists for CheckTrainsLengths

pull/10548/head
SamuXarick 2024-01-02 22:04:45 +00:00
parent e9a4f865b0
commit 8c17fad1e0
1 changed files with 18 additions and 14 deletions

View File

@ -77,7 +77,10 @@ void CheckTrainsLengths()
{
bool first = true;
for (const Train *v : Train::Iterate()) {
for (const Company *c : Company::Iterate()) {
const VehicleList &vehicle_list = c->group_all[VEH_TRAIN].vehicle_list;
for (const Vehicle *vehicle : vehicle_list) {
const Train *v = Train::From(vehicle);
if (v->First() == v && !(v->vehstatus & VS_CRASHED)) {
for (const Train *u = v, *w = v->Next(); w != nullptr; u = w, w = w->Next()) {
if (u->track != TRACK_BIT_DEPOT) {
@ -99,6 +102,7 @@ void CheckTrainsLengths()
}
}
}
}
}
/**