1
0
mirror of https://github.com/OpenRCT2/OpenRCT2 synced 2026-01-19 13:03:11 +01:00

Increase limit on Loan Interest from 80% to 255%

Co-authored-by: Gymnasiast <m.o.steenbeek@gmail.com>
This commit is contained in:
73
2022-09-27 06:20:01 -04:00
committed by GitHub
parent 84abc2ab83
commit a8073f6bd5
6 changed files with 9 additions and 5 deletions

View File

@@ -508,7 +508,7 @@ private:
Invalidate();
break;
case WIDX_INTEREST_RATE_INCREASE:
if (gBankLoanInterestRate < 80)
if (gBankLoanInterestRate < MaxBankLoanInterestRate)
{
auto scenarioSetSetting = ScenarioSetSettingAction(
ScenarioSetSetting::AnnualInterestRate, gBankLoanInterestRate + 1);
@@ -523,7 +523,7 @@ private:
case WIDX_INTEREST_RATE_DECREASE:
if (gBankLoanInterestRate > 0)
{
auto interest = std::min(80, gBankLoanInterestRate - 1);
auto interest = std::min<uint8_t>(MaxBankLoanInterestRate, gBankLoanInterestRate - 1);
auto scenarioSetSetting = ScenarioSetSettingAction(ScenarioSetSetting::AnnualInterestRate, interest);
GameActions::Execute(&scenarioSetSetting);
}

View File

@@ -30,6 +30,7 @@
#include "interface/Window_internal.h"
#include "localisation/Localisation.h"
#include "localisation/LocalisationService.h"
#include "management/Finance.h"
#include "management/NewsItem.h"
#include "object/DefaultObjects.h"
#include "object/ObjectManager.h"
@@ -377,7 +378,7 @@ namespace Editor
gMaxBankLoan = std::clamp<money64>(gMaxBankLoan, 0.00_GBP, 5000000.00_GBP);
gBankLoanInterestRate = std::clamp<uint8_t>(gBankLoanInterestRate, 5, 80);
gBankLoanInterestRate = std::clamp<uint8_t>(gBankLoanInterestRate, 5, MaxBankLoanInterestRate);
}
climate_reset(gClimate);

View File

@@ -89,7 +89,7 @@ GameActions::Result ScenarioSetSettingAction::Execute() const
window_invalidate_by_class(WindowClass::Finances);
break;
case ScenarioSetSetting::AnnualInterestRate:
gBankLoanInterestRate = std::clamp<uint8_t>(_value, 0, 80);
gBankLoanInterestRate = std::clamp<uint8_t>(_value, 0, MaxBankLoanInterestRate);
window_invalidate_by_class(WindowClass::Finances);
break;
case ScenarioSetSetting::ForbidMarketingCampaigns:

View File

@@ -34,6 +34,8 @@ enum class ExpenditureType : int32_t
#define EXPENDITURE_TABLE_MONTH_COUNT 16
#define FINANCE_GRAPH_SIZE 128
constexpr const uint8_t MaxBankLoanInterestRate = 255;
extern const money32 research_cost_table[RESEARCH_FUNDING_COUNT];
extern money64 gInitialCash;

View File

@@ -42,7 +42,7 @@
// This string specifies which version of network stream current build uses.
// It is used for making sure only compatible builds get connected, even within
// single OpenRCT2 version.
#define NETWORK_STREAM_VERSION "19"
#define NETWORK_STREAM_VERSION "20"
#define NETWORK_STREAM_ID OPENRCT2_VERSION "-" NETWORK_STREAM_VERSION
static Peep* _pickup_peep = nullptr;