From 8063e965b89c987608cb5bde7352274ebb7fca60 Mon Sep 17 00:00:00 2001 From: Gymnasiast Date: Sun, 9 May 2021 20:04:04 +0200 Subject: [PATCH] Fix weekly profit import --- src/openrct2/rct1/S4Importer.cpp | 2 +- src/openrct2/rct2/S6Importer.cpp | 4 ++-- src/openrct2/scenario/Scenario.h | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/openrct2/rct1/S4Importer.cpp b/src/openrct2/rct1/S4Importer.cpp index db9e819980..3cacd6a69f 100644 --- a/src/openrct2/rct1/S4Importer.cpp +++ b/src/openrct2/rct1/S4Importer.cpp @@ -1375,7 +1375,7 @@ private: { gCashHistory[i] = _s4.cash_history[i]; gParkValueHistory[i] = ToMoney64(CorrectRCT1ParkValue(_s4.park_value_history[i])); - gWeeklyProfitHistory[i] = _s4.weekly_profit_history[i]; + gWeeklyProfitHistory[i] = ToMoney64(_s4.weekly_profit_history[i]); } for (size_t i = 0; i < RCT12_EXPENDITURE_TABLE_MONTH_COUNT; i++) diff --git a/src/openrct2/rct2/S6Importer.cpp b/src/openrct2/rct2/S6Importer.cpp index 044458d404..e34896446b 100644 --- a/src/openrct2/rct2/S6Importer.cpp +++ b/src/openrct2/rct2/S6Importer.cpp @@ -308,7 +308,7 @@ public: gCurrentExpenditure = _s6.current_expenditure; gCurrentProfit = _s6.current_profit; - gWeeklyProfitAverageDividend = _s6.weekly_profit_average_dividend; + gWeeklyProfitAverageDividend = ToMoney64(_s6.weekly_profit_average_dividend); gWeeklyProfitAverageDivisor = _s6.weekly_profit_average_divisor; // pad_0135833A @@ -317,7 +317,7 @@ public: for (size_t i = 0; i < RCT12_FINANCE_GRAPH_SIZE; i++) { gCashHistory[i] = _s6.balance_history[i]; - gWeeklyProfitHistory[i] = _s6.weekly_profit_history[i]; + gWeeklyProfitHistory[i] = ToMoney64(_s6.weekly_profit_history[i]); gParkValueHistory[i] = ToMoney64(_s6.park_value_history[i]); } diff --git a/src/openrct2/scenario/Scenario.h b/src/openrct2/scenario/Scenario.h index 1197917925..7e00f2ed06 100644 --- a/src/openrct2/scenario/Scenario.h +++ b/src/openrct2/scenario/Scenario.h @@ -194,7 +194,7 @@ struct rct_s6_data // SC6[11] money32 current_expenditure; money32 current_profit; - uint32_t weekly_profit_average_dividend; + money32 weekly_profit_average_dividend; uint16_t weekly_profit_average_divisor; uint8_t pad_0135833A[2];