From 1f8b7950bc42b0821f0b413984cd68f83ae89ec6 Mon Sep 17 00:00:00 2001 From: Hielke Morsink Date: Thu, 25 Jan 2024 12:33:02 +0100 Subject: [PATCH] Get size of WeeklyProfitHistory in compile time --- src/openrct2/world/Park.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/openrct2/world/Park.cpp b/src/openrct2/world/Park.cpp index 57934ce757..d9c0d8a572 100644 --- a/src/openrct2/world/Park.cpp +++ b/src/openrct2/world/Park.cpp @@ -773,13 +773,14 @@ void Park::UpdateHistories() { currentWeeklyProfit /= gameState.WeeklyProfitAverageDivisor; } - HistoryPushRecord(gameState.WeeklyProfitHistory, currentWeeklyProfit); + constexpr auto profitHistorySize = std::extent_v; + HistoryPushRecord(gameState.WeeklyProfitHistory, currentWeeklyProfit); gameState.WeeklyProfitAverageDividend = 0; gameState.WeeklyProfitAverageDivisor = 0; // Update park value history - HistoryPushRecord>( - gameState.ParkValueHistory, gameState.ParkValue); + constexpr auto parkValueHistorySize = std::extent_v; + HistoryPushRecord(gameState.ParkValueHistory, gameState.ParkValue); // Invalidate relevant windows auto intent = Intent(INTENT_ACTION_UPDATE_GUEST_COUNT);