diff options
author | smatz <smatz@openttd.org> | 2008-02-09 15:07:31 +0000 |
---|---|---|
committer | smatz <smatz@openttd.org> | 2008-02-09 15:07:31 +0000 |
commit | d00bf03012ec14e42e96002be248b2365e44f872 (patch) | |
tree | 39d675de46311d80d06cf6872b5082be1a1c732f /src/command.cpp | |
parent | a7b786f143b0a4a8cdf94f9fbea5ed92048760c6 (diff) | |
download | openttd-d00bf03012ec14e42e96002be248b2365e44f872.tar.xz |
(svn r12094) -Codechange: use DC_BANKRUPT command flag when removing player property to allow further fixes
Diffstat (limited to 'src/command.cpp')
-rw-r--r-- | src/command.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/command.cpp b/src/command.cpp index bb7e91456..b37222293 100644 --- a/src/command.cpp +++ b/src/command.cpp @@ -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)) { |