summaryrefslogtreecommitdiff
path: root/src/misc_cmd.cpp
diff options
context:
space:
mode:
authorrubidium <rubidium@openttd.org>2007-06-21 14:54:51 +0000
committerrubidium <rubidium@openttd.org>2007-06-21 14:54:51 +0000
commit1b27095c830d0e9fb399cf5340d2cf58db388e21 (patch)
treeffd3d611e2ebf0a91d072c95d635063bf018b1fd /src/misc_cmd.cpp
parent0d8e82b7d742b54216bf6bc8a1d3b4eafe8124ab (diff)
downloadopenttd-1b27095c830d0e9fb399cf5340d2cf58db388e21.tar.xz
(svn r10247) -Fix (r10210): *always* call SetDParamMoney when you want to place money in some string.
Diffstat (limited to 'src/misc_cmd.cpp')
-rw-r--r--src/misc_cmd.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/misc_cmd.cpp b/src/misc_cmd.cpp
index 69ecbf29d..ac546aa08 100644
--- a/src/misc_cmd.cpp
+++ b/src/misc_cmd.cpp
@@ -129,7 +129,7 @@ CommandCost CmdIncreaseLoan(TileIndex tile, uint32 flags, uint32 p1, uint32 p2)
Player *p = GetPlayer(_current_player);
if (p->current_loan >= _economy.max_loan) {
- SetDParam(0, _economy.max_loan);
+ SetDParamMoney(0, _economy.max_loan);
return_cmd_error(STR_702B_MAXIMUM_PERMITTED_LOAN);
}
@@ -173,7 +173,7 @@ CommandCost CmdDecreaseLoan(TileIndex tile, uint32 flags, uint32 p1, uint32 p2)
switch (p2) {
default: return CMD_ERROR; // Invalid method
case 0: // Pay back one step
- loan = min(p->current_loan, (IsHumanPlayer(_current_player) || _patches.ainew_active) ? LOAN_INTERVAL : LOAN_INTERVAL_OLD_AI);
+ loan = min(p->current_loan, (Money)(IsHumanPlayer(_current_player) || _patches.ainew_active) ? LOAN_INTERVAL : LOAN_INTERVAL_OLD_AI);
break;
case 1: // Pay back as much as possible
loan = max(min(p->current_loan, p->player_money), (Money)LOAN_INTERVAL);
@@ -182,7 +182,7 @@ CommandCost CmdDecreaseLoan(TileIndex tile, uint32 flags, uint32 p1, uint32 p2)
}
if (p->player_money < loan) {
- SetDParam(0, loan);
+ SetDParamMoney(0, loan);
return_cmd_error(STR_702E_REQUIRED);
}
@@ -307,7 +307,7 @@ CommandCost CmdMoneyCheat(TileIndex tile, uint32 flags, uint32 p1, uint32 p2)
CommandCost CmdGiveMoney(TileIndex tile, uint32 flags, uint32 p1, uint32 p2)
{
const Player *p = GetPlayer(_current_player);
- CommandCost amount(min((Money)p1, 20000000LL));
+ CommandCost amount(min((Money)p1, (Money)20000000LL));
SET_EXPENSES_TYPE(EXPENSES_OTHER);