# HG changeset patch # User rubidium # Date 1180390302 0 # Node ID 520481b11c2c3f312b348eb652b9b1f3c30a8829 # Parent 207038be130228bc55b3f6af7fba56f6f475a1bf (svn r9968) [0.5] -Backport from trunk (r9966): - Fix: bridges and tunnels were not always removed on bankruptcy, thus leaving tunnels/bridges with an invalid owner that would crash the game when clicking with the query tool on them. diff -r 207038be1302 -r 520481b11c2c tunnelbridge_cmd.c --- a/tunnelbridge_cmd.c Thu May 17 19:47:04 2007 +0000 +++ b/tunnelbridge_cmd.c Mon May 28 22:11:42 2007 +0000 @@ -1349,7 +1349,13 @@ SetTileOwner(tile, OWNER_NONE); } } else { - DoCommand(tile, 0, 0, DC_EXEC, CMD_LANDSCAPE_CLEAR); + if (CmdFailed(DoCommand(tile, 0, 0, DC_EXEC, 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. + * In that case we can safely reassign the ownership to OWNER_NONE. */ + SetTileOwner(tile, OWNER_NONE); + } } } }