Mercurial > hg > openttd
comparison src/rail_cmd.cpp @ 8519:0e4b2a37af1f draft
(svn r12094) -Codechange: use DC_BANKRUPT command flag when removing player property to allow further fixes
author | smatz <smatz@openttd.org> |
---|---|
date | Sat, 09 Feb 2008 15:07:31 +0000 |
parents | 124ea89a5409 |
children | 76d0527eea17 |
comparison
equal
deleted
inserted
replaced
8518:60d7ff4383fb | 8519:0e4b2a37af1f |
---|---|
453 switch (GetTileType(tile)) { | 453 switch (GetTileType(tile)) { |
454 case MP_ROAD: { | 454 case MP_ROAD: { |
455 if (!IsLevelCrossing(tile) || | 455 if (!IsLevelCrossing(tile) || |
456 GetCrossingRailBits(tile) != trackbit || | 456 GetCrossingRailBits(tile) != trackbit || |
457 (_current_player != OWNER_WATER && !CheckTileOwnership(tile)) || | 457 (_current_player != OWNER_WATER && !CheckTileOwnership(tile)) || |
458 !EnsureNoVehicleOnGround(tile)) { | 458 (!(flags & DC_BANKRUPT) && !EnsureNoVehicleOnGround(tile))) { |
459 return CMD_ERROR; | 459 return CMD_ERROR; |
460 } | 460 } |
461 | 461 |
462 if (flags & DC_EXEC) { | 462 if (flags & DC_EXEC) { |
463 owner = GetTileOwner(tile); | 463 owner = GetTileOwner(tile); |
2144 if (!IsTileOwner(tile, old_player)) return; | 2144 if (!IsTileOwner(tile, old_player)) return; |
2145 | 2145 |
2146 if (new_player != PLAYER_SPECTATOR) { | 2146 if (new_player != PLAYER_SPECTATOR) { |
2147 SetTileOwner(tile, new_player); | 2147 SetTileOwner(tile, new_player); |
2148 } else { | 2148 } else { |
2149 DoCommand(tile, 0, 0, DC_EXEC, CMD_LANDSCAPE_CLEAR); | 2149 DoCommand(tile, 0, 0, DC_EXEC | DC_BANKRUPT, CMD_LANDSCAPE_CLEAR); |
2150 } | 2150 } |
2151 } | 2151 } |
2152 | 2152 |
2153 static const byte _fractcoords_behind[4] = { 0x8F, 0x8, 0x80, 0xF8 }; | 2153 static const byte _fractcoords_behind[4] = { 0x8F, 0x8, 0x80, 0xF8 }; |
2154 static const byte _fractcoords_enter[4] = { 0x8A, 0x48, 0x84, 0xA8 }; | 2154 static const byte _fractcoords_enter[4] = { 0x8A, 0x48, 0x84, 0xA8 }; |