diff --git a/src/openrct2/GameState.h b/src/openrct2/GameState.h index 3c27462715..dda5e8bd4c 100644 --- a/src/openrct2/GameState.h +++ b/src/openrct2/GameState.h @@ -42,8 +42,6 @@ namespace OpenRCT2 uint32_t currentTicks{}; Date date; - // The total profit for the entire scenario that precedes the current financial table. - money64 historicalProfit; money64 constructionRightsPrice; money64 currentExpenditure; money64 currentProfit; diff --git a/src/openrct2/management/Finance.cpp b/src/openrct2/management/Finance.cpp index 65ef14b8c9..e401d1f12e 100644 --- a/src/openrct2/management/Finance.cpp +++ b/src/openrct2/management/Finance.cpp @@ -231,7 +231,7 @@ void FinanceInit() gameState.bankLoanInterestRate = 10; gameState.park.Value = 0; gameState.park.companyValue = 0; - gameState.historicalProfit = 0; + gameState.park.historicalProfit = 0; gameState.scenarioCompletedCompanyValue = kMoney64Undefined; gameState.totalAdmissions = 0; gameState.totalIncomeFromAdmissions = 0; @@ -326,7 +326,7 @@ void FinanceShiftExpenditureTable() std::cbegin(gameState.expenditureTable[kExpenditureTableMonthCount - 1]), std::cend(gameState.expenditureTable[kExpenditureTableMonthCount - 1]), money64{}); - gameState.historicalProfit += sum; + gameState.park.historicalProfit += sum; } // Shift the table diff --git a/src/openrct2/park/ParkFile.cpp b/src/openrct2/park/ParkFile.cpp index c8da7a4be8..70cfa89e73 100644 --- a/src/openrct2/park/ParkFile.cpp +++ b/src/openrct2/park/ParkFile.cpp @@ -942,7 +942,7 @@ namespace OpenRCT2 } } } - cs.ReadWrite(gameState.historicalProfit); + cs.ReadWrite(gameState.park.historicalProfit); // Marketing cs.ReadWriteVector(gameState.marketingCampaigns, [&cs](MarketingCampaign& campaign) { diff --git a/src/openrct2/rct2/S6Importer.cpp b/src/openrct2/rct2/S6Importer.cpp index 60806b606e..653a3a855f 100644 --- a/src/openrct2/rct2/S6Importer.cpp +++ b/src/openrct2/rct2/S6Importer.cpp @@ -520,7 +520,7 @@ namespace OpenRCT2::RCT2 gameState.scenarioCompanyValueRecord = _s6.CompletedCompanyValueRecord; // _s6.LoanHash; // Pad013587CA - gameState.historicalProfit = ToMoney64(_s6.HistoricalProfit); + gameState.park.historicalProfit = ToMoney64(_s6.HistoricalProfit); // Pad013587D4 gameState.scenarioCompletedBy = std::string_view(_s6.ScenarioCompletedName, sizeof(_s6.ScenarioCompletedName)); gameState.park.cash = ToMoney64(DECRYPT_MONEY(_s6.Cash)); diff --git a/src/openrct2/scenario/Scenario.cpp b/src/openrct2/scenario/Scenario.cpp index 8828560ffe..d135cb7790 100644 --- a/src/openrct2/scenario/Scenario.cpp +++ b/src/openrct2/scenario/Scenario.cpp @@ -108,7 +108,7 @@ void ScenarioReset(GameState_t& gameState) gameState.park.Rating = Park::CalculateParkRating(); gameState.park.Value = Park::CalculateParkValue(); gameState.park.companyValue = Park::CalculateCompanyValue(); - gameState.historicalProfit = gameState.initialCash - gameState.bankLoan; + gameState.park.historicalProfit = gameState.initialCash - gameState.bankLoan; gameState.park.cash = gameState.initialCash; auto& objManager = GetContext()->GetObjectManager(); diff --git a/src/openrct2/world/ParkData.h b/src/openrct2/world/ParkData.h index 69b6d99c2a..7818814035 100644 --- a/src/openrct2/world/ParkData.h +++ b/src/openrct2/world/ParkData.h @@ -69,6 +69,9 @@ namespace OpenRCT2::Park money64 cash; money64 cashHistory[kFinanceHistorySize]; + // The total profit for the entire scenario that precedes the current financial table. + money64 historicalProfit; + money64 companyValue; }; } // namespace OpenRCT2::Park