diff --git a/bridge.h b/bridge.h index b7000513d9..8ea8f9882c 100644 --- a/bridge.h +++ b/bridge.h @@ -27,5 +27,6 @@ extern const Bridge orig_bridge[MAX_BRIDGES]; extern Bridge _bridge[MAX_BRIDGES]; uint GetBridgeFoundation(Slope tileh, Axis axis); +uint GetBridgeHeightRamp(TileIndex t); #endif /* BRIDGE_H */ diff --git a/tunnelbridge_cmd.c b/tunnelbridge_cmd.c index 1f24daf264..893972358b 100644 --- a/tunnelbridge_cmd.c +++ b/tunnelbridge_cmd.c @@ -611,7 +611,7 @@ static int32 DoClearTunnel(TileIndex tile, uint32 flags) } -static uint GetBridgeHeightRamp(TileIndex t) +uint GetBridgeHeightRamp(TileIndex t) { uint h; uint tileh = GetTileSlope(t, &h); diff --git a/water_cmd.c b/water_cmd.c index 81ca489295..dc01025614 100644 --- a/water_cmd.c +++ b/water_cmd.c @@ -20,6 +20,7 @@ #include "train.h" #include "water_map.h" #include "newgrf.h" +#include "bridge.h" const SpriteID _water_shore_sprites[15] = { 0, @@ -617,10 +618,10 @@ static Vehicle *FindFloodableVehicleOnTile(TileIndex tile) byte z; Vehicle *v; - if (!IsBridgeTile(tile)) return FindVehicleOnTileZ(tile, 0); + if (!IsBridgeTile(tile) || !IsBridgeRamp(tile)) return FindVehicleOnTileZ(tile, 0); end = GetOtherBridgeEnd(tile); - z = GetBridgeHeight(tile); + z = GetBridgeHeightRamp(tile); /* check the start tile first since as this is closest to the water */ v = FindVehicleOnTileZ(tile, z);