diff options
author | smatz <smatz@openttd.org> | 2008-06-11 15:56:55 +0000 |
---|---|---|
committer | smatz <smatz@openttd.org> | 2008-06-11 15:56:55 +0000 |
commit | 6d4474d81900914a745c41d07a21dca11e04ff14 (patch) | |
tree | 29d59014c3ee2ba4f7e2ed5d6f1f2494dbd18f53 | |
parent | 7b8b5f9a8d5a13ebc198bedafa52d8fcc7cfa71e (diff) | |
download | openttd-6d4474d81900914a745c41d07a21dca11e04ff14.tar.xz |
(svn r13475) -Fix (r13464): crash on destroying aquaduct with ship on in and on company bankrupt
-rw-r--r-- | src/tunnelbridge_cmd.cpp | 4 | ||||
-rw-r--r-- | src/vehicle.cpp | 2 |
2 files changed, 3 insertions, 3 deletions
diff --git a/src/tunnelbridge_cmd.cpp b/src/tunnelbridge_cmd.cpp index f26bd7c58..ada5f3625 100644 --- a/src/tunnelbridge_cmd.cpp +++ b/src/tunnelbridge_cmd.cpp @@ -1268,9 +1268,9 @@ static void ChangeTileOwner_TunnelBridge(TileIndex tile, PlayerID old_player, Pl if (CmdFailed(DoCommand(tile, 0, 0, DC_EXEC | DC_BANKRUPT, CMD_LANDSCAPE_CLEAR))) { /* When clearing the bridge/tunnel failed there are still vehicles on/in * the bridge/tunnel. As all *our* vehicles are already removed, they - * must be of another owner. Therefor this must be a road bridge/tunnel. + * must be of another owner. Therefore this can't be rail tunnel/bridge. * In that case we can safely reassign the ownership to OWNER_NONE. */ - assert(GetTunnelBridgeTransportType(tile) == TRANSPORT_ROAD); + assert(GetTunnelBridgeTransportType(tile) != TRANSPORT_RAIL); SetTileOwner(tile, OWNER_NONE); } } diff --git a/src/vehicle.cpp b/src/vehicle.cpp index 5d57e0dba..bda5efefd 100644 --- a/src/vehicle.cpp +++ b/src/vehicle.cpp @@ -206,7 +206,7 @@ Vehicle *FindVehicleBetween(TileIndex from, TileIndex to, byte z, bool without_c /** Procedure called for every vehicle found in tunnel/bridge in the hash map */ static void *GetVehicleTunnelBridgeProc(Vehicle *v, void *data) { - if (v->type != VEH_TRAIN && v->type != VEH_ROAD) return NULL; + if (v->type != VEH_TRAIN && v->type != VEH_ROAD && v->type != VEH_SHIP) return NULL; _error_message = VehicleInTheWayErrMsg(v); return v; |