Add cargo mask of town production cargoes

Use for all non-GUI cases (where display sort order is not required)
This commit is contained in:
Jonathan G Rennison
2024-02-19 03:49:35 +00:00
parent 8581808952
commit 19e4895ffd
6 changed files with 36 additions and 22 deletions

View File

@@ -194,10 +194,8 @@ SpriteID TileZoneCheckUnservedBuildingsEvaluation(TileIndex tile, Owner owner)
}
auto has_town_cargo = [&](const CargoArray &dat) {
for (auto tpe : {TPE_PASSENGERS, TPE_MAIL}) {
for (const CargoSpec *cs : CargoSpec::town_production_cargoes[tpe]) {
if (dat[cs->Index()] > 0) return true;
}
for (CargoID cid : SetCargoBitIterator(CargoSpec::town_production_cargo_mask[TPE_PASSENGERS] | CargoSpec::town_production_cargo_mask[TPE_MAIL])) {
if (dat[cid] > 0) return true;
}
return false;
};