From eb1472a82d8007a1deddc25ae81f872e7a91abe5 Mon Sep 17 00:00:00 2001 From: rubidium Date: Thu, 21 Jun 2007 14:54:51 +0000 Subject: (svn r10247) -Fix (r10210): *always* call SetDParamMoney when you want to place money in some string. --- src/misc_cmd.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src/misc_cmd.cpp') 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); -- cgit v1.2.3-54-g00ecf