diff --git a/src/openrct2/editor.c b/src/openrct2/editor.c index 121df94093..dcc491576e 100644 --- a/src/openrct2/editor.c +++ b/src/openrct2/editor.c @@ -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: diff --git a/src/openrct2/windows/editor_scenario_options.c b/src/openrct2/windows/editor_scenario_options.c index 6f6f8d7c43..6f32eae5cf 100644 --- a/src/openrct2/windows/editor_scenario_options.c +++ b/src/openrct2/windows/editor_scenario_options.c @@ -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); }