Zoning: Fix unserved industry mode with passenger-handling industries
This commit is contained in:
@@ -231,8 +231,21 @@ SpriteID TileZoneCheckUnservedIndustriesEvaluation(TileIndex tile, Owner owner)
|
|||||||
if (ind->neutral_station != nullptr) return ZONING_INVALID_SPRITE_ID;
|
if (ind->neutral_station != nullptr) return ZONING_INVALID_SPRITE_ID;
|
||||||
|
|
||||||
for (const Station *st : ind->stations_near) {
|
for (const Station *st : ind->stations_near) {
|
||||||
if (st->owner == owner && st->facilities & (~FACIL_BUS_STOP)) {
|
if (st->owner == owner) {
|
||||||
return ZONING_INVALID_SPRITE_ID;
|
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;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user