Zoning: Fix unserved industry mode with passenger-handling industries

pull/363/head
Jonathan G Rennison 2 years ago
parent 22e72b1ecd
commit afa75ded1c

@ -231,8 +231,21 @@ SpriteID TileZoneCheckUnservedIndustriesEvaluation(TileIndex tile, Owner owner)
if (ind->neutral_station != nullptr) return ZONING_INVALID_SPRITE_ID;
for (const Station *st : ind->stations_near) {
if (st->owner == owner && st->facilities & (~FACIL_BUS_STOP)) {
return ZONING_INVALID_SPRITE_ID;
if (st->owner == owner) {
if (st->facilities & (~(FACIL_BUS_STOP | FACIL_TRUCK_STOP)) || st->facilities == (FACIL_BUS_STOP | FACIL_TRUCK_STOP)) {
return ZONING_INVALID_SPRITE_ID;
} else if (st->facilities & (FACIL_BUS_STOP | FACIL_TRUCK_STOP)) {
for (uint i = 0; i < lengthof(ind->produced_cargo); i++) {
if (ind->produced_cargo[i] != CT_INVALID && st->facilities & (IsCargoInClass(ind->produced_cargo[i], CC_PASSENGERS) ? FACIL_BUS_STOP : FACIL_TRUCK_STOP)) {
return ZONING_INVALID_SPRITE_ID;
}
}
for (uint i = 0; i < lengthof(ind->accepts_cargo); i++) {
if (ind->accepts_cargo[i] != CT_INVALID && st->facilities & (IsCargoInClass(ind->accepts_cargo[i], CC_PASSENGERS) ? FACIL_BUS_STOP : FACIL_TRUCK_STOP)) {
return ZONING_INVALID_SPRITE_ID;
}
}
}
}
}

Loading…
Cancel
Save