summaryrefslogtreecommitdiff
path: root/src/command.cpp
diff options
context:
space:
mode:
authorsmatz <smatz@openttd.org>2008-02-09 15:07:31 +0000
committersmatz <smatz@openttd.org>2008-02-09 15:07:31 +0000
commit802c94975523114d472cc2c37ccd858d3e6358a2 (patch)
tree39d675de46311d80d06cf6872b5082be1a1c732f /src/command.cpp
parent221494bd3fa26c47294424b4c53f28f494a38a53 (diff)
downloadopenttd-802c94975523114d472cc2c37ccd858d3e6358a2.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.cpp3
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)) {