mirror of
https://github.com/OpenTTD/OpenTTD.git
synced 2025-02-06 22:37:22 +00:00
(svn r11574) -Fix: flood train stations when there are no trains on border tiles too (when non-uniform stations are OFF)
This commit is contained in:
parent
8c5c0e9367
commit
c65c14f06b
@ -664,6 +664,20 @@ static Vehicle *FindFloodableVehicleOnTile(TileIndex tile)
|
|||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* if non-uniform stations are disabled, flood some train in this train station (if there is any) */
|
||||||
|
if (!_patches.nonuniform_stations && IsTileType(tile, MP_STATION) && GetStationType(tile) == STATION_RAIL) {
|
||||||
|
const Station *st = GetStationByTile(tile);
|
||||||
|
|
||||||
|
BEGIN_TILE_LOOP(t, st->trainst_w, st->trainst_h, st->train_tile)
|
||||||
|
if (st->TileBelongsToRailStation(t)) {
|
||||||
|
Vehicle *v = FindVehicleOnTileZ(t, 0);
|
||||||
|
if (v != NULL && (v->vehstatus & VS_CRASHED) == 0) return v;
|
||||||
|
}
|
||||||
|
END_TILE_LOOP(t, st->trainst_w, st->trainst_h, st->train_tile)
|
||||||
|
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
|
||||||
if (!IsBridgeTile(tile)) return FindVehicleOnTileZ(tile, 0);
|
if (!IsBridgeTile(tile)) return FindVehicleOnTileZ(tile, 0);
|
||||||
|
|
||||||
TileIndex end = GetOtherBridgeEnd(tile);
|
TileIndex end = GetOtherBridgeEnd(tile);
|
||||||
|
Loading…
Reference in New Issue
Block a user