diff options
author | rubidium <rubidium@openttd.org> | 2007-02-05 14:00:32 +0000 |
---|---|---|
committer | rubidium <rubidium@openttd.org> | 2007-02-05 14:00:32 +0000 |
commit | 1bf688e5b5a4d9cb509d06d0d2946cdca819f294 (patch) | |
tree | 2a77cbed0dc7302a8fb16e3d9a211adf52f983d6 /src/vehicle.cpp | |
parent | cf5f19520cbb8aca1c5bf66f3b5ea89b492248cf (diff) | |
download | openttd-1bf688e5b5a4d9cb509d06d0d2946cdca819f294.tar.xz |
(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.
Diffstat (limited to 'src/vehicle.cpp')
-rw-r--r-- | src/vehicle.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/vehicle.cpp b/src/vehicle.cpp index 8ee5d62b2..94fe2660a 100644 --- a/src/vehicle.cpp +++ b/src/vehicle.cpp @@ -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) { |