mirror of
https://github.com/OpenRCT2/OpenRCT2
synced 2025-12-10 17:42:29 +01:00
Move gCurrentExpenditure to GameState_t
This commit is contained in:
@@ -42,6 +42,7 @@ namespace OpenRCT2
|
||||
money64 ParkValueHistory[FINANCE_GRAPH_SIZE];
|
||||
money64 CompanyValue;
|
||||
money64 ConstructionRightsPrice;
|
||||
money64 CurrentExpenditure;
|
||||
uint8_t ParkRatingHistory[32];
|
||||
ClimateType Climate;
|
||||
ClimateState ClimateCurrent;
|
||||
|
||||
@@ -39,7 +39,6 @@ static constexpr int32_t dword_988E60[static_cast<int32_t>(ExpenditureType::Coun
|
||||
1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 0, 0,
|
||||
};
|
||||
|
||||
money64 gCurrentExpenditure;
|
||||
money64 gCurrentProfit;
|
||||
money64 gHistoricalProfit;
|
||||
money64 gCashHistory[FINANCE_GRAPH_SIZE];
|
||||
@@ -88,7 +87,7 @@ void FinancePayment(money64 amount, ExpenditureType type)
|
||||
if (dword_988E60[static_cast<int32_t>(type)] & 1)
|
||||
{
|
||||
// Cumulative amount of money spent this day
|
||||
gCurrentExpenditure -= amount;
|
||||
gameState.CurrentExpenditure -= amount;
|
||||
}
|
||||
|
||||
auto intent = Intent(INTENT_ACTION_UPDATE_CASH);
|
||||
@@ -220,7 +219,7 @@ void FinanceInit()
|
||||
gExpenditureTable[0][i] = 0;
|
||||
}
|
||||
|
||||
gCurrentExpenditure = 0;
|
||||
gameState.CurrentExpenditure = 0;
|
||||
gCurrentProfit = 0;
|
||||
|
||||
gameState.WeeklyProfitAverageDividend = 0;
|
||||
@@ -250,12 +249,12 @@ void FinanceInit()
|
||||
void FinanceUpdateDailyProfit()
|
||||
{
|
||||
PROFILED_FUNCTION();
|
||||
auto& gameState = GetGameState();
|
||||
|
||||
gCurrentProfit = 7 * gCurrentExpenditure;
|
||||
gCurrentExpenditure = 0; // Reset daily expenditure
|
||||
gCurrentProfit = 7 * gameState.CurrentExpenditure;
|
||||
gameState.CurrentExpenditure = 0; // Reset daily expenditure
|
||||
|
||||
money64 current_profit = 0;
|
||||
auto& gameState = GetGameState();
|
||||
|
||||
if (!(gameState.ParkFlags & PARK_FLAGS_NO_MONEY))
|
||||
{
|
||||
|
||||
@@ -38,7 +38,6 @@ constexpr uint8_t MaxBankLoanInterestRate = 255;
|
||||
|
||||
extern const money64 research_cost_table[RESEARCH_FUNDING_COUNT];
|
||||
|
||||
extern money64 gCurrentExpenditure;
|
||||
extern money64 gCurrentProfit;
|
||||
|
||||
/**
|
||||
|
||||
@@ -891,7 +891,7 @@ namespace OpenRCT2
|
||||
cs.ReadWrite(gameState.NumGuestsHeadingForPark);
|
||||
cs.ReadWrite(gameState.ParkRating);
|
||||
cs.ReadWrite(gParkRatingCasualtyPenalty);
|
||||
cs.ReadWrite(gCurrentExpenditure);
|
||||
cs.ReadWrite(gameState.CurrentExpenditure);
|
||||
cs.ReadWrite(gCurrentProfit);
|
||||
cs.ReadWrite(gameState.WeeklyProfitAverageDividend);
|
||||
cs.ReadWrite(gameState.WeeklyProfitAverageDivisor);
|
||||
|
||||
@@ -1420,7 +1420,7 @@ namespace RCT1
|
||||
gExpenditureTable[i][j] = ToMoney64(_s4.Expenditure[i][j]);
|
||||
}
|
||||
}
|
||||
gCurrentExpenditure = ToMoney64(_s4.TotalExpenditure);
|
||||
gameState.CurrentExpenditure = ToMoney64(_s4.TotalExpenditure);
|
||||
|
||||
gameState.ScenarioCompletedCompanyValue = RCT12CompletedCompanyValueToOpenRCT2(_s4.CompletedCompanyValue);
|
||||
gameState.TotalAdmissions = _s4.NumAdmissions;
|
||||
|
||||
@@ -356,7 +356,7 @@ namespace RCT2
|
||||
gameState.ScenarioObjective.NumGuests = _s6.ObjectiveGuests;
|
||||
ImportMarketingCampaigns();
|
||||
|
||||
gCurrentExpenditure = ToMoney64(_s6.CurrentExpenditure);
|
||||
gameState.CurrentExpenditure = ToMoney64(_s6.CurrentExpenditure);
|
||||
gCurrentProfit = ToMoney64(_s6.CurrentProfit);
|
||||
gameState.WeeklyProfitAverageDividend = ToMoney64(_s6.WeeklyProfitAverageDividend);
|
||||
gameState.WeeklyProfitAverageDivisor = _s6.WeeklyProfitAverageDivisor;
|
||||
|
||||
@@ -134,7 +134,7 @@ void ScenarioReset(GameState_t& gameState)
|
||||
auto savePath = env->GetDirectoryPath(DIRBASE::USER, DIRID::SAVE);
|
||||
gScenarioSavePath = Path::Combine(savePath, park.Name + u8".park");
|
||||
|
||||
gCurrentExpenditure = 0;
|
||||
gameState.CurrentExpenditure = 0;
|
||||
gCurrentProfit = 0;
|
||||
gameState.WeeklyProfitAverageDividend = 0;
|
||||
gameState.WeeklyProfitAverageDivisor = 0;
|
||||
|
||||
Reference in New Issue
Block a user