Use Window iterate instead of from front/back when no order required

This commit is contained in:
Jonathan G Rennison
2023-09-18 18:34:50 +01:00
parent cd2a368d77
commit 52e4688851
8 changed files with 23 additions and 23 deletions

View File

@@ -2751,7 +2751,7 @@ void DirtyVehicleListWindowForVehicle(const Vehicle *v)
{
WindowClass cls = static_cast<WindowClass>(WC_TRAINS_LIST + v->type);
WindowClass cls2 = (v->type == VEH_TRAIN) ? WC_TRACE_RESTRICT_SLOTS : cls;
for (Window *w : Window::IterateFromBack()) {
for (Window *w : Window::Iterate()) {
if (w->window_class == cls || w->window_class == cls2) {
BaseVehicleListWindow *listwin = static_cast<BaseVehicleListWindow *>(w);
uint max = std::min<uint>(listwin->vscroll->GetPosition() + listwin->vscroll->GetCapacity(), (uint)listwin->vehgroups.size());