mirror of
https://github.com/OpenTTD/OpenTTD.git
synced 2025-08-17 19:49:10 +00:00
(svn r10247) -Fix (r10210): *always* call SetDParamMoney when you want to place money in some string.
This commit is contained in:
@@ -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);
|
||||
|
||||
|
Reference in New Issue
Block a user