From 0058ebe47264dfadc400137776a9342ccb61c0f0 Mon Sep 17 00:00:00 2001 From: Peter Nelson Date: Sat, 16 Mar 2024 19:37:32 +0000 Subject: [PATCH] Codechange: Check cheap station-facility-filter before expensive in-use-filter. (#12317) --- src/station_gui.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/station_gui.cpp b/src/station_gui.cpp index 6926fa15f5..bc081bd685 100644 --- a/src/station_gui.cpp +++ b/src/station_gui.cpp @@ -260,8 +260,8 @@ protected: this->stations_per_cargo_type_no_rating = 0; for (const Station *st : Station::Iterate()) { - if (st->owner == owner || (st->owner == OWNER_NONE && HasStationInUse(st->index, true, owner))) { - if (this->filter.facilities & st->facilities) { // only stations with selected facilities + if ((this->filter.facilities & st->facilities) != 0) { // only stations with selected facilities + if (st->owner == owner || (st->owner == OWNER_NONE && HasStationInUse(st->index, true, owner))) { bool has_rating = false; /* Add to the station/cargo counts. */ for (CargoID j = 0; j < NUM_CARGO; j++) {