diff src/command.cpp @ 6990:a19700261804 draft

(svn r10246) -Fix (r10297): some forgotten money conversions and truncation issues. Thanks to benc for providing the patch.
author rubidium <rubidium@openttd.org>
date Thu, 21 Jun 2007 14:32:27 +0000 (2007-06-21)
parents cb6b3e277df0
children 68c101a3230f
line wrap: on
line diff
--- a/src/command.cpp
+++ b/src/command.cpp
@@ -418,10 +418,10 @@
 	return res;
 }
 
-int32 GetAvailableMoneyForCommand()
+Money GetAvailableMoneyForCommand()
 {
 	PlayerID pid = _current_player;
-	if (!IsValidPlayer(pid)) return 0x7FFFFFFF; // max int
+	if (!IsValidPlayer(pid)) return INT64_MAX;
 	return GetPlayer(pid)->player_money;
 }
 
@@ -568,7 +568,7 @@
 
 	if (IsLocalPlayer() && _game_mode != GM_EDITOR) {
 		if (res2.GetCost() != 0) ShowCostOrIncomeAnimation(x, y, GetSlopeZ(x, y), res2.GetCost());
-		if (_additional_cash_required) {
+		if (_additional_cash_required != 0) {
 			SetDParam(0, _additional_cash_required);
 			ShowErrorMessage(STR_0003_NOT_ENOUGH_CASH_REQUIRES, error_part1, x, y);
 			if (res2.GetCost() == 0) goto callb_err;