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

This commit is contained in:
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];
uint GetBridgeFoundation(Slope tileh, Axis axis);
uint GetBridgeHeightRamp(TileIndex t);
#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 tileh = GetTileSlope(t, &h);

View File

@ -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);