mirror of
https://github.com/OpenTTD/OpenTTD.git
synced 2025-03-11 01:49:50 +00:00
(svn r9726) -Fix [FS#738]: crash when destroying bridge with train partially one it.
This commit is contained in:
parent
49cd2374bb
commit
6b37ea7b47
@ -639,10 +639,11 @@ static int32 DoClearBridge(TileIndex tile, uint32 flags)
|
|||||||
if (!CheckAllowRemoveTunnelBridge(tile)) return CMD_ERROR;
|
if (!CheckAllowRemoveTunnelBridge(tile)) return CMD_ERROR;
|
||||||
|
|
||||||
endtile = GetOtherBridgeEnd(tile);
|
endtile = GetOtherBridgeEnd(tile);
|
||||||
|
byte bridge_height = GetBridgeHeight(tile);
|
||||||
|
|
||||||
if (!EnsureNoVehicleOnGround(tile) ||
|
if (FindVehicleOnTileZ(tile, bridge_height) != NULL ||
|
||||||
!EnsureNoVehicleOnGround(endtile) ||
|
FindVehicleOnTileZ(endtile, bridge_height) != NULL ||
|
||||||
IsVehicleOnBridge(tile, endtile, GetBridgeHeight(tile))) {
|
IsVehicleOnBridge(tile, endtile, bridge_height)) {
|
||||||
return CMD_ERROR;
|
return CMD_ERROR;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -743,10 +744,11 @@ int32 DoConvertTunnelBridgeRail(TileIndex tile, RailType totype, bool exec)
|
|||||||
if (!CheckTileOwnership(tile)) return CMD_ERROR;
|
if (!CheckTileOwnership(tile)) return CMD_ERROR;
|
||||||
|
|
||||||
endtile = GetOtherBridgeEnd(tile);
|
endtile = GetOtherBridgeEnd(tile);
|
||||||
|
byte bridge_height = GetBridgeHeight(tile);
|
||||||
|
|
||||||
if (!EnsureNoVehicleOnGround(tile) ||
|
if (FindVehicleOnTileZ(tile, bridge_height) != NULL ||
|
||||||
!EnsureNoVehicleOnGround(endtile) ||
|
FindVehicleOnTileZ(endtile, bridge_height) != NULL ||
|
||||||
IsVehicleOnBridge(tile, endtile, GetBridgeHeight(tile))) {
|
IsVehicleOnBridge(tile, endtile, bridge_height)) {
|
||||||
return CMD_ERROR;
|
return CMD_ERROR;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user