Sync "Raise / lower interest rate"

This commit is contained in:
wolfreak99 authored and Michael Steenbeek committed 2017-04-11 14:26:31 +02:00
1 parent 8c07613eed
commit 2a8481bd48
2 files changed
+38 -5

No files matched your search

+2 -1
View File
@@ -582,7 +582,8 @@ void game_command_edit_scenario_options(sint32* eax, sint32* ebx, sint32* ecx, s
window_invalidate_by_class(WC_FINANCES);
break;
case EDIT_SCENARIOOPTIONS_SETANNUALINTERESTRATE:
gBankLoanInterestRate = max(0, min(80, *edx));
window_invalidate_by_class(WC_FINANCES);
break;
case EDIT_SCENARIOOPTIONS_SETFORBIDMARKETINGCAMPAIGNS:
+36 -4
View File
@@ -633,9 +633,25 @@ static void window_editor_scenario_options_financial_mousedown(sint32 widgetInde
case WIDX_INTEREST_RATE_INCREASE:
if (gBankLoanInterestRate < 80) {
if (gBankLoanInterestRate < 0) {
gBankLoanInterestRate = 0;
game_do_command(
0,
GAME_COMMAND_FLAG_APPLY,
EDIT_SCENARIOOPTIONS_SETANNUALINTERESTRATE,
0,
GAME_COMMAND_EDIT_SCENARIO_OPTIONS,
0,
0
);
} else {
gBankLoanInterestRate++;
game_do_command(
0,
GAME_COMMAND_FLAG_APPLY,
EDIT_SCENARIOOPTIONS_SETANNUALINTERESTRATE,
gBankLoanInterestRate + 1,
GAME_COMMAND_EDIT_SCENARIO_OPTIONS,
0,
0
);
}
} else {
window_error_open(STR_CANT_INCREASE_INTEREST_RATE, STR_NONE);
@@ -645,9 +661,25 @@ static void window_editor_scenario_options_financial_mousedown(sint32 widgetInde
case WIDX_INTEREST_RATE_DECREASE:
if (gBankLoanInterestRate > 0) {
if (gBankLoanInterestRate > 80) {
gBankLoanInterestRate = 80;
game_do_command(
0,
GAME_COMMAND_FLAG_APPLY,
EDIT_SCENARIOOPTIONS_SETANNUALINTERESTRATE,
80,
GAME_COMMAND_EDIT_SCENARIO_OPTIONS,
0,
0
);
} else {
gBankLoanInterestRate--;
game_do_command(
0,
GAME_COMMAND_FLAG_APPLY,
EDIT_SCENARIOOPTIONS_SETANNUALINTERESTRATE,
gBankLoanInterestRate - 1,
GAME_COMMAND_EDIT_SCENARIO_OPTIONS,
0,
0
);
}
} else {
window_error_open(STR_CANT_REDUCE_INTEREST_RATE, STR_NONE);