src/command.cpp
changeset 8519 fe61d7aa3053
parent 8500 133710926f7a
child 8652 671ecccd18ad
equal deleted inserted replaced
8518:9f64c88bb3e9 8519:fe61d7aa3053
   420 			goto error;
   420 			goto error;
   421 		}
   421 		}
   422 
   422 
   423 		if (_docommand_recursive == 1 &&
   423 		if (_docommand_recursive == 1 &&
   424 				!(flags & DC_QUERY_COST) &&
   424 				!(flags & DC_QUERY_COST) &&
       
   425 				!(flags & DC_BANKRUPT) &&
   425 				res.GetCost() != 0 &&
   426 				res.GetCost() != 0 &&
   426 				!CheckPlayerHasMoney(res)) {
   427 				!CheckPlayerHasMoney(res)) {
   427 			goto error;
   428 			goto error;
   428 		}
   429 		}
   429 
   430 
   444 		_cmd_text = NULL;
   445 		_cmd_text = NULL;
   445 		return CMD_ERROR;
   446 		return CMD_ERROR;
   446 	}
   447 	}
   447 
   448 
   448 	/* if toplevel, subtract the money. */
   449 	/* if toplevel, subtract the money. */
   449 	if (--_docommand_recursive == 0) {
   450 	if (--_docommand_recursive == 0 && !(flags & DC_BANKRUPT)) {
   450 		SubtractMoneyFromPlayer(res);
   451 		SubtractMoneyFromPlayer(res);
   451 		/* XXX - Old AI hack which doesn't use DoCommandDP; update last build coord of player */
   452 		/* XXX - Old AI hack which doesn't use DoCommandDP; update last build coord of player */
   452 		if (tile != 0 && IsValidPlayer(_current_player)) {
   453 		if (tile != 0 && IsValidPlayer(_current_player)) {
   453 			GetPlayer(_current_player)->last_build_coordinate = tile;
   454 			GetPlayer(_current_player)->last_build_coordinate = tile;
   454 		}
   455 		}