mirror of https://github.com/OpenTTD/OpenTTD
Codechange: Iterate group vehicle list for PropagateChildLivery
parent
4ee690b911
commit
1fb35c5cce
|
@ -293,12 +293,11 @@ static void PropagateChildLivery(const Group *g, bool reset_cache)
|
||||||
{
|
{
|
||||||
if (reset_cache) {
|
if (reset_cache) {
|
||||||
/* Company colour data is indirectly cached. */
|
/* Company colour data is indirectly cached. */
|
||||||
for (Vehicle *v : Vehicle::Iterate()) {
|
const VehicleList &vehicle_list = g->statistics.vehicle_list;
|
||||||
if (v->group_id == g->index && (!v->IsGroundVehicle() || v->IsFrontEngine())) {
|
for (const Vehicle *v : vehicle_list) {
|
||||||
for (Vehicle *u = v; u != nullptr; u = u->Next()) {
|
for (Vehicle *u = Vehicle::Get(v->index); u != nullptr; u = u->Next()) {
|
||||||
u->colourmap = PAL_NONE;
|
u->colourmap = PAL_NONE;
|
||||||
u->InvalidateNewGRFCache();
|
u->InvalidateNewGRFCache();
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue