mirror of
https://github.com/OpenRCT2/OpenRCT2
synced 2026-01-06 06:32:56 +01:00
Finance: remove pre-gamestate accessor functions
This commit is contained in:
@@ -307,26 +307,6 @@ void FinanceUpdateDailyProfit()
|
||||
windowMgr->InvalidateByClass(WindowClass::Finances);
|
||||
}
|
||||
|
||||
money64 FinanceGetInitialCash()
|
||||
{
|
||||
return getGameState().scenarioOptions.initialCash;
|
||||
}
|
||||
|
||||
money64 FinanceGetCurrentLoan()
|
||||
{
|
||||
return getGameState().park.bankLoan;
|
||||
}
|
||||
|
||||
money64 FinanceGetMaximumLoan()
|
||||
{
|
||||
return getGameState().park.maxBankLoan;
|
||||
}
|
||||
|
||||
money64 FinanceGetCurrentCash()
|
||||
{
|
||||
return getGameState().park.cash;
|
||||
}
|
||||
|
||||
/**
|
||||
* Shift the expenditure table history one month to the left
|
||||
* If the table is full, accumulate the sum of the oldest month first
|
||||
|
||||
@@ -51,9 +51,4 @@ void FinanceUpdateDailyProfit();
|
||||
void FinanceShiftExpenditureTable();
|
||||
void FinanceResetCashToInitial();
|
||||
|
||||
money64 FinanceGetInitialCash();
|
||||
money64 FinanceGetCurrentLoan();
|
||||
money64 FinanceGetMaximumLoan();
|
||||
money64 FinanceGetCurrentCash();
|
||||
|
||||
money64 FinanceGetLastMonthShopProfit();
|
||||
|
||||
@@ -533,7 +533,7 @@ namespace OpenRCT2::Park
|
||||
auto result = park.value - park.bankLoan;
|
||||
|
||||
// Clamp addition to prevent overflow
|
||||
result = AddClamp<money64>(result, FinanceGetCurrentCash());
|
||||
result = AddClamp<money64>(result, park.cash);
|
||||
|
||||
return result;
|
||||
}
|
||||
@@ -611,7 +611,7 @@ namespace OpenRCT2::Park
|
||||
HistoryPushRecord<uint32_t, numGuestsHistorySize>(park.guestsInParkHistory, park.numGuestsInPark);
|
||||
|
||||
constexpr auto cashHistorySize = std::extent_v<decltype(ParkData::cashHistory)>;
|
||||
HistoryPushRecord<money64, cashHistorySize>(park.cashHistory, FinanceGetCurrentCash() - park.bankLoan);
|
||||
HistoryPushRecord<money64, cashHistorySize>(park.cashHistory, park.cash - park.bankLoan);
|
||||
|
||||
// Update weekly profit history
|
||||
auto currentWeeklyProfit = park.weeklyProfitAverageDividend;
|
||||
|
||||
Reference in New Issue
Block a user