1
0
Fork 0

(svn r8687) [0.5] -Fix [FS#617]: assertion when getting the height of a bridge from the ramp tile.

release/0.5
rubidium 2007-02-12 10:03:42 +00:00
parent 9aa9579283
commit 2d3a64ffcc
3 changed files with 5 additions and 3 deletions

View File

@ -27,5 +27,6 @@ extern const Bridge orig_bridge[MAX_BRIDGES];
extern Bridge _bridge[MAX_BRIDGES]; extern Bridge _bridge[MAX_BRIDGES];
uint GetBridgeFoundation(Slope tileh, Axis axis); uint GetBridgeFoundation(Slope tileh, Axis axis);
uint GetBridgeHeightRamp(TileIndex t);
#endif /* BRIDGE_H */ #endif /* BRIDGE_H */

View File

@ -611,7 +611,7 @@ static int32 DoClearTunnel(TileIndex tile, uint32 flags)
} }
static uint GetBridgeHeightRamp(TileIndex t) uint GetBridgeHeightRamp(TileIndex t)
{ {
uint h; uint h;
uint tileh = GetTileSlope(t, &h); uint tileh = GetTileSlope(t, &h);

View File

@ -20,6 +20,7 @@
#include "train.h" #include "train.h"
#include "water_map.h" #include "water_map.h"
#include "newgrf.h" #include "newgrf.h"
#include "bridge.h"
const SpriteID _water_shore_sprites[15] = { const SpriteID _water_shore_sprites[15] = {
0, 0,
@ -617,10 +618,10 @@ static Vehicle *FindFloodableVehicleOnTile(TileIndex tile)
byte z; byte z;
Vehicle *v; Vehicle *v;
if (!IsBridgeTile(tile)) return FindVehicleOnTileZ(tile, 0); if (!IsBridgeTile(tile) || !IsBridgeRamp(tile)) return FindVehicleOnTileZ(tile, 0);
end = GetOtherBridgeEnd(tile); end = GetOtherBridgeEnd(tile);
z = GetBridgeHeight(tile); z = GetBridgeHeightRamp(tile);
/* check the start tile first since as this is closest to the water */ /* check the start tile first since as this is closest to the water */
v = FindVehicleOnTileZ(tile, z); v = FindVehicleOnTileZ(tile, z);