summaryrefslogtreecommitdiff
path: root/src/command.cpp
diff options
context:
space:
mode:
authorrubidium <rubidium@openttd.org>2007-06-21 14:32:27 +0000
committerrubidium <rubidium@openttd.org>2007-06-21 14:32:27 +0000
commitf806b46cc967202db3d2fbf3384d0f037c13ed8a (patch)
tree4d9bfa9de886f7ff167c4fa02326f5cd302e8cce /src/command.cpp
parent06fded123a346d556ceb2f4585429046ddf8f1b9 (diff)
downloadopenttd-f806b46cc967202db3d2fbf3384d0f037c13ed8a.tar.xz
(svn r10246) -Fix (r10297): some forgotten money conversions and truncation issues. Thanks to benc for providing the patch.
Diffstat (limited to 'src/command.cpp')
-rw-r--r--src/command.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/command.cpp b/src/command.cpp
index a400307dc..3aa93777c 100644
--- a/src/command.cpp
+++ b/src/command.cpp
@@ -418,10 +418,10 @@ error:
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 @@ bool DoCommandP(TileIndex tile, uint32 p1, uint32 p2, CommandCallback *callback,
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;