1
0
Fork 0

Codechange: Iterate group vehicle list for PropagateChildLivery

pull/10548/head
SamuXarick 2023-12-30 17:54:09 +00:00
parent 4ee690b911
commit 1fb35c5cce
1 changed files with 5 additions and 6 deletions

View File

@ -293,15 +293,14 @@ static void PropagateChildLivery(const Group *g, bool reset_cache)
{
if (reset_cache) {
/* Company colour data is indirectly cached. */
for (Vehicle *v : Vehicle::Iterate()) {
if (v->group_id == g->index && (!v->IsGroundVehicle() || v->IsFrontEngine())) {
for (Vehicle *u = v; u != nullptr; u = u->Next()) {
const VehicleList &vehicle_list = g->statistics.vehicle_list;
for (const Vehicle *v : vehicle_list) {
for (Vehicle *u = Vehicle::Get(v->index); u != nullptr; u = u->Next()) {
u->colourmap = PAL_NONE;
u->InvalidateNewGRFCache();
}
}
}
}
for (Group *cg : Group::Iterate()) {
if (cg->parent == g->index) {