mirror of https://github.com/OpenRCT2/OpenRCT2.git
parent
14d14de911
commit
446796db4b
|
@ -125,17 +125,18 @@ void finance_pay_research()
|
||||||
*/
|
*/
|
||||||
void finance_pay_interest()
|
void finance_pay_interest()
|
||||||
{
|
{
|
||||||
money32 current_loan = gBankLoan;
|
// This variable uses the 64-bit type as the computation below can involve multiplying very large numbers
|
||||||
uint8 current_interest = gBankLoanInterestRate;
|
// that will overflow money32 if the loan is greater than (1 << 31) / (5 * current_interest_rate)
|
||||||
|
money64 current_loan = gBankLoan;
|
||||||
// This variable uses the 64-bit type as the line below can involve multiplying very large numbers
|
uint8 current_interest_rate = gBankLoanInterestRate;
|
||||||
// that will overflow money32 (e.g. in the Alton Towers RCT1 scenario)
|
money32 interest_to_pay;
|
||||||
money64 tempcost = (current_loan * 5 * current_interest) >> 14; // (5 * interest) / 2^14 is pretty close to
|
|
||||||
|
|
||||||
if (gParkFlags & PARK_FLAGS_NO_MONEY)
|
if (gParkFlags & PARK_FLAGS_NO_MONEY)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
finance_payment(tempcost, RCT_EXPENDITURE_TYPE_INTEREST);
|
interest_to_pay = (current_loan * 5 * current_interest_rate) >> 14;
|
||||||
|
|
||||||
|
finance_payment(interest_to_pay, RCT_EXPENDITURE_TYPE_INTEREST);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -55,7 +55,7 @@ extern "C" {
|
||||||
// This define specifies which version of network stream current build uses.
|
// This define specifies which version of network stream current build uses.
|
||||||
// It is used for making sure only compatible builds get connected, even within
|
// It is used for making sure only compatible builds get connected, even within
|
||||||
// single OpenRCT2 version.
|
// single OpenRCT2 version.
|
||||||
#define NETWORK_STREAM_VERSION "25"
|
#define NETWORK_STREAM_VERSION "26"
|
||||||
#define NETWORK_STREAM_ID OPENRCT2_VERSION "-" NETWORK_STREAM_VERSION
|
#define NETWORK_STREAM_ID OPENRCT2_VERSION "-" NETWORK_STREAM_VERSION
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
|
|
Loading…
Reference in New Issue