From d00bf03012ec14e42e96002be248b2365e44f872 Mon Sep 17 00:00:00 2001 From: smatz Date: Sat, 9 Feb 2008 15:07:31 +0000 Subject: (svn r12094) -Codechange: use DC_BANKRUPT command flag when removing player property to allow further fixes --- src/command.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/command.cpp') 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)) { -- cgit v1.2.3-70-g09d2