1
0
mirror of https://github.com/OpenTTD/OpenTTD.git synced 2025-08-21 05:29:11 +00:00

(svn r12094) -Codechange: use DC_BANKRUPT command flag when removing player property to allow further fixes

This commit is contained in:
smatz
2008-02-09 15:07:31 +00:00
parent 221494bd3f
commit 802c949755
7 changed files with 11 additions and 9 deletions

View File

@@ -422,6 +422,7 @@ CommandCost DoCommand(TileIndex tile, uint32 p1, uint32 p2, uint32 flags, uint32
if (_docommand_recursive == 1 &&
!(flags & DC_QUERY_COST) &&
!(flags & DC_BANKRUPT) &&
res.GetCost() != 0 &&
!CheckPlayerHasMoney(res)) {
goto error;
@@ -446,7 +447,7 @@ error:
}
/* if toplevel, subtract the money. */
if (--_docommand_recursive == 0) {
if (--_docommand_recursive == 0 && !(flags & DC_BANKRUPT)) {
SubtractMoneyFromPlayer(res);
/* XXX - Old AI hack which doesn't use DoCommandDP; update last build coord of player */
if (tile != 0 && IsValidPlayer(_current_player)) {