1
0
mirror of https://github.com/OpenTTD/OpenTTD.git synced 2025-08-25 15:39:09 +00:00

Codechange: Check cheap station-facility-filter before expensive in-use-filter. (#12317)

This commit is contained in:
2024-03-16 19:37:32 +00:00
committed by GitHub
parent 818a57c9af
commit 0058ebe472

View File

@@ -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++) {