Sync "Raise / lower initial loan size"

This commit is contained in:
wolfreak99 2017-02-23 09:02:52 -05:00 committed by Michael Steenbeek
parent 0932854f7c
commit e096314f89
2 changed files with 21 additions and 5 deletions

View File

@ -572,7 +572,9 @@ void game_command_edit_scenario_options(sint32* eax, sint32* ebx, sint32* ecx, s
window_invalidate_by_class(WC_BOTTOM_TOOLBAR);
break;
case EDIT_SCENARIOOPTIONS_SETINITIALLOAN:
gBankLoan = max(MONEY(0,00), min(MONEY(5000000,00), *edx));
gMaxBankLoan = max(gBankLoan, gMaxBankLoan);
window_invalidate_by_class(WC_FINANCES);
break;
case EDIT_SCENARIOOPTIONS_SETMAXIMUMLOANSIZE:

View File

@ -568,8 +568,15 @@ static void window_editor_scenario_options_financial_mousedown(sint32 widgetInde
break;
case WIDX_INITIAL_LOAN_INCREASE:
if (gBankLoan < MONEY(5000000,00)) {
gBankLoan += MONEY(1000,00);
gMaxBankLoan = max(gBankLoan, gMaxBankLoan);
game_do_command(
0,
GAME_COMMAND_FLAG_APPLY,
EDIT_SCENARIOOPTIONS_SETINITIALLOAN,
gBankLoan + MONEY(1000,00),
GAME_COMMAND_EDIT_SCENARIO_OPTIONS,
0,
0
);
} else {
window_error_open(STR_CANT_INCREASE_INIT_LOAN, STR_NONE);
}
@ -577,8 +584,15 @@ static void window_editor_scenario_options_financial_mousedown(sint32 widgetInde
break;
case WIDX_INITIAL_LOAN_DECREASE:
if (gBankLoan > MONEY(0,00)) {
gBankLoan -= MONEY(1000,00);
gMaxBankLoan = max(gBankLoan, gMaxBankLoan);
game_do_command(
0,
GAME_COMMAND_FLAG_APPLY,
EDIT_SCENARIOOPTIONS_SETINITIALLOAN,
gBankLoan - MONEY(1000,00),
GAME_COMMAND_EDIT_SCENARIO_OPTIONS,
0,
0
);
} else {
window_error_open(STR_CANT_REDUCE_INIT_LOAN, STR_NONE);
}