mirror of https://github.com/OpenTTD/OpenTTD.git
(svn r8687) [0.5] -Fix [FS#617]: assertion when getting the height of a bridge from the ramp tile.
This commit is contained in:
parent
9aa9579283
commit
2d3a64ffcc
1
bridge.h
1
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 */
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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);
|
||||
|
|
Loading…
Reference in New Issue