diff --git a/src/openrct2-ui/windows/Finances.cpp b/src/openrct2-ui/windows/Finances.cpp index 816c8bf758..614d9857bf 100644 --- a/src/openrct2-ui/windows/Finances.cpp +++ b/src/openrct2-ui/windows/Finances.cpp @@ -652,7 +652,7 @@ namespace OpenRCT2::Ui::Windows ft.Add(gameState.park.Value); DrawTextBasic(rt, windowPos + ScreenCoordsXY{ 280, titleBarBottom + 265 }, STR_PARK_VALUE_LABEL, ft); ft = Formatter(); - ft.Add(gameState.companyValue); + ft.Add(gameState.park.companyValue); DrawTextBasic(rt, windowPos + ScreenCoordsXY{ 280, titleBarBottom + 280 }, STR_COMPANY_VALUE_LABEL, ft); } } diff --git a/src/openrct2/GameState.h b/src/openrct2/GameState.h index 053fc084c7..3c27462715 100644 --- a/src/openrct2/GameState.h +++ b/src/openrct2/GameState.h @@ -41,13 +41,14 @@ namespace OpenRCT2 std::string pluginStorage; uint32_t currentTicks{}; Date date; - money64 companyValue; + // The total profit for the entire scenario that precedes the current financial table. money64 historicalProfit; money64 constructionRightsPrice; money64 currentExpenditure; money64 currentProfit; uint32_t guestsInParkHistory[kGuestsInParkHistorySize]; + WeatherState weatherCurrent; WeatherState weatherNext; uint16_t weatherUpdateTimer; diff --git a/src/openrct2/interface/InteractiveConsole.cpp b/src/openrct2/interface/InteractiveConsole.cpp index 8f028ac305..4bb2bbcf81 100644 --- a/src/openrct2/interface/InteractiveConsole.cpp +++ b/src/openrct2/interface/InteractiveConsole.cpp @@ -557,7 +557,7 @@ static void ConsoleCommandGet(InteractiveConsole& console, const arguments_t& ar } else if (argv[0] == "company_value") { - console.WriteLine(FormatString("company_value {CURRENCY2DP}", gameState.companyValue)); + console.WriteLine(FormatString("company_value {CURRENCY2DP}", gameState.park.companyValue)); } else if (argv[0] == "money") { diff --git a/src/openrct2/management/Finance.cpp b/src/openrct2/management/Finance.cpp index 3a8583f1fc..65ef14b8c9 100644 --- a/src/openrct2/management/Finance.cpp +++ b/src/openrct2/management/Finance.cpp @@ -230,7 +230,7 @@ void FinanceInit() gameState.bankLoanInterestRate = 10; gameState.park.Value = 0; - gameState.companyValue = 0; + gameState.park.companyValue = 0; gameState.historicalProfit = 0; gameState.scenarioCompletedCompanyValue = kMoney64Undefined; gameState.totalAdmissions = 0; diff --git a/src/openrct2/park/ParkFile.cpp b/src/openrct2/park/ParkFile.cpp index 48e06e0f20..c8da7a4be8 100644 --- a/src/openrct2/park/ParkFile.cpp +++ b/src/openrct2/park/ParkFile.cpp @@ -977,7 +977,7 @@ namespace OpenRCT2 }); } cs.ReadWrite(gameState.park.Value); - cs.ReadWrite(gameState.companyValue); + cs.ReadWrite(gameState.park.companyValue); cs.ReadWrite(gameState.park.Size); cs.ReadWrite(gameState.numGuestsInPark); cs.ReadWrite(gameState.numGuestsHeadingForPark); diff --git a/src/openrct2/rct1/S4Importer.cpp b/src/openrct2/rct1/S4Importer.cpp index c9d6f076e1..2cebd4c09c 100644 --- a/src/openrct2/rct1/S4Importer.cpp +++ b/src/openrct2/rct1/S4Importer.cpp @@ -1511,7 +1511,7 @@ namespace OpenRCT2::RCT1 gameState.bankLoanInterestRate = 1; gameState.initialCash = ToMoney64(_s4.Cash); - gameState.companyValue = ToMoney64(_s4.CompanyValue); + gameState.park.companyValue = ToMoney64(_s4.CompanyValue); gameState.park.Value = CorrectRCT1ParkValue(_s4.ParkValue); gameState.currentProfit = ToMoney64(_s4.Profit); diff --git a/src/openrct2/rct2/S6Importer.cpp b/src/openrct2/rct2/S6Importer.cpp index 604e13e295..60806b606e 100644 --- a/src/openrct2/rct2/S6Importer.cpp +++ b/src/openrct2/rct2/S6Importer.cpp @@ -498,7 +498,7 @@ namespace OpenRCT2::RCT2 gameState.scenarioCompletedCompanyValue = RCT12CompletedCompanyValueToOpenRCT2(_s6.CompletedCompanyValue); gameState.totalAdmissions = _s6.TotalAdmissions; gameState.totalIncomeFromAdmissions = ToMoney64(_s6.IncomeFromAdmissions); - gameState.companyValue = ToMoney64(_s6.CompanyValue); + gameState.park.companyValue = ToMoney64(_s6.CompanyValue); std::memcpy(gameState.peepWarningThrottle, _s6.PeepWarningThrottle, sizeof(_s6.PeepWarningThrottle)); // Awards diff --git a/src/openrct2/scenario/Scenario.cpp b/src/openrct2/scenario/Scenario.cpp index 699aaa4a4a..8828560ffe 100644 --- a/src/openrct2/scenario/Scenario.cpp +++ b/src/openrct2/scenario/Scenario.cpp @@ -107,7 +107,7 @@ void ScenarioReset(GameState_t& gameState) gameState.park.Rating = Park::CalculateParkRating(); gameState.park.Value = Park::CalculateParkValue(); - gameState.companyValue = Park::CalculateCompanyValue(); + gameState.park.companyValue = Park::CalculateCompanyValue(); gameState.historicalProfit = gameState.initialCash - gameState.bankLoan; gameState.park.cash = gameState.initialCash; @@ -193,7 +193,7 @@ void ScenarioFailure(GameState_t& gameState) */ void ScenarioSuccess(GameState_t& gameState) { - auto companyValue = gameState.companyValue; + auto companyValue = gameState.park.companyValue; gameState.scenarioCompletedCompanyValue = companyValue; PeepApplause(); diff --git a/src/openrct2/scripting/bindings/world/ScPark.cpp b/src/openrct2/scripting/bindings/world/ScPark.cpp index 76f5108da6..c0a8f7ef33 100644 --- a/src/openrct2/scripting/bindings/world/ScPark.cpp +++ b/src/openrct2/scripting/bindings/world/ScPark.cpp @@ -198,16 +198,16 @@ namespace OpenRCT2::Scripting money64 ScPark::companyValue_get() const { - return getGameState().companyValue; + return getGameState().park.companyValue; } void ScPark::companyValue_set(money64 value) { ThrowIfGameStateNotMutable(); auto& gameState = getGameState(); - if (gameState.companyValue != value) + if (gameState.park.companyValue != value) { - gameState.companyValue = value; + gameState.park.companyValue = value; auto intent = Intent(INTENT_ACTION_UPDATE_CASH); ContextBroadcastIntent(&intent); } diff --git a/src/openrct2/scripting/bindings/world/ScScenario.hpp b/src/openrct2/scripting/bindings/world/ScScenario.hpp index f6babef307..7d9a7d2e31 100644 --- a/src/openrct2/scripting/bindings/world/ScScenario.hpp +++ b/src/openrct2/scripting/bindings/world/ScScenario.hpp @@ -291,7 +291,7 @@ namespace OpenRCT2::Scripting else if (value == "failed") gameState.scenarioCompletedCompanyValue = kCompanyValueOnFailedObjective; else if (value == "completed") - gameState.scenarioCompletedCompanyValue = gameState.companyValue; + gameState.scenarioCompletedCompanyValue = gameState.park.companyValue; } money64 companyValueRecord_get() const diff --git a/src/openrct2/world/Park.cpp b/src/openrct2/world/Park.cpp index bdad842bad..7a66d57fc4 100644 --- a/src/openrct2/world/Park.cpp +++ b/src/openrct2/world/Park.cpp @@ -345,7 +345,7 @@ namespace OpenRCT2::Park { gameState.park.Rating = CalculateParkRating(); gameState.park.Value = Park::CalculateParkValue(); - gameState.companyValue = CalculateCompanyValue(); + gameState.park.companyValue = CalculateCompanyValue(); gameState.totalRideValueForMoney = calculateTotalRideValueForMoney(); gameState.suggestedGuestMaximum = calculateSuggestedMaxGuests(); gameState.guestGenerationProbability = calculateGuestGenerationProbability(); diff --git a/src/openrct2/world/ParkData.h b/src/openrct2/world/ParkData.h index 73d9d10b24..69b6d99c2a 100644 --- a/src/openrct2/world/ParkData.h +++ b/src/openrct2/world/ParkData.h @@ -68,5 +68,7 @@ namespace OpenRCT2::Park money64 cash; money64 cashHistory[kFinanceHistorySize]; + + money64 companyValue; }; } // namespace OpenRCT2::Park