forked from mirror/OpenTTD
(svn r8593) -Fix (FS#564): bridges do not get destroyed when the bridge head gets flooded and there is a vehicle on the bridge. Original patch by KeeperofTheSoul.
This commit is contained in:
@@ -167,7 +167,7 @@ Vehicle *FindVehicleOnTileZ(TileIndex tile, byte z)
|
||||
return (Vehicle*)VehicleFromPos(tile, &ti, EnsureNoVehicleProcZ);
|
||||
}
|
||||
|
||||
Vehicle *FindVehicleBetween(TileIndex from, TileIndex to, byte z)
|
||||
Vehicle *FindVehicleBetween(TileIndex from, TileIndex to, byte z, bool without_crashed)
|
||||
{
|
||||
int x1 = TileX(from);
|
||||
int y1 = TileY(from);
|
||||
@@ -181,6 +181,7 @@ Vehicle *FindVehicleBetween(TileIndex from, TileIndex to, byte z)
|
||||
intswap(y1,y2);
|
||||
}
|
||||
FOR_ALL_VEHICLES(veh) {
|
||||
if (without_crashed && (veh->vehstatus & VS_CRASHED) != 0) continue;
|
||||
if ((veh->type == VEH_Train || veh->type == VEH_Road) && (z==0xFF || veh->z_pos == z)) {
|
||||
if ((veh->x_pos>>4) >= x1 && (veh->x_pos>>4) <= x2 &&
|
||||
(veh->y_pos>>4) >= y1 && (veh->y_pos>>4) <= y2) {
|
||||
|
Reference in New Issue
Block a user