mirror of
https://github.com/OpenRCT2/OpenRCT2
synced 2026-01-17 03:53:07 +01:00
Integrate gHistoricalProfit
This commit is contained in:
@@ -54,6 +54,7 @@ uint8 gBankLoanInterestRate;
|
||||
money32 gMaxBankLoan;
|
||||
money32 gCurrentExpenditure;
|
||||
money32 gCurrentProfit;
|
||||
money32 gHistoricalProfit;
|
||||
money32 gWeeklyProfitAverageDividend;
|
||||
uint16 gWeeklyProfitAverageDivisor;
|
||||
money32 gCashHistory[128];
|
||||
@@ -194,7 +195,7 @@ void finance_init() {
|
||||
gBankLoan = MONEY(10000,00);
|
||||
gMaxBankLoan = MONEY(20000,00);
|
||||
|
||||
RCT2_GLOBAL(0x013587D0, uint32) = 0;
|
||||
gHistoricalProfit = 0;
|
||||
|
||||
gBankLoanInterestRate = 10;
|
||||
gParkValue = 0;
|
||||
@@ -335,7 +336,7 @@ void finance_shift_expenditure_table()
|
||||
for (uint32 i = EXPENDITURE_TABLE_TOTAL_COUNT - RCT_EXPENDITURE_TYPE_COUNT; i < EXPENDITURE_TABLE_TOTAL_COUNT; i++) {
|
||||
sum += gExpenditureTable[i];
|
||||
}
|
||||
RCT2_GLOBAL(0x013587D0, money32) += sum;
|
||||
gHistoricalProfit += sum;
|
||||
}
|
||||
|
||||
// Shift the table
|
||||
|
||||
@@ -52,6 +52,13 @@ extern uint8 gBankLoanInterestRate;
|
||||
extern money32 gMaxBankLoan;
|
||||
extern money32 gCurrentExpenditure;
|
||||
extern money32 gCurrentProfit;
|
||||
|
||||
/**
|
||||
* The total profit for the entire scenario that preceeds
|
||||
* the current financial table.
|
||||
*/
|
||||
extern money32 gHistoricalProfit;
|
||||
|
||||
extern money32 gWeeklyProfitAverageDividend;
|
||||
extern uint16 gWeeklyProfitAverageDivisor;
|
||||
extern money32 gCashHistory[128];
|
||||
|
||||
@@ -355,7 +355,7 @@ void S6Exporter::Export()
|
||||
_s6.loan_hash = GetLoanHash(gInitialCash, gBankLoan, gMaxBankLoan);
|
||||
_s6.ride_count = RCT2_GLOBAL(RCT2_ADDRESS_RIDE_COUNT, uint16);
|
||||
// pad_013587CA
|
||||
_s6.dword_013587D0 = RCT2_GLOBAL(0x013587D0, uint32);
|
||||
_s6.historical_profit = gHistoricalProfit;
|
||||
// pad_013587D4
|
||||
memcpy(_s6.scenario_completed_name, gScenarioCompletedBy, sizeof(_s6.scenario_completed_name));
|
||||
_s6.cash = gCashEncrypted;
|
||||
|
||||
@@ -273,7 +273,7 @@ void S6Importer::Import()
|
||||
// _s6.loan_hash;
|
||||
RCT2_GLOBAL(RCT2_ADDRESS_RIDE_COUNT, uint16) = _s6.ride_count;
|
||||
// pad_013587CA
|
||||
RCT2_GLOBAL(0x013587D0, uint32) = _s6.dword_013587D0;
|
||||
gHistoricalProfit = _s6.historical_profit;
|
||||
// pad_013587D4
|
||||
memcpy(gScenarioCompletedBy, _s6.scenario_completed_name, sizeof(_s6.scenario_completed_name));
|
||||
gCashEncrypted = _s6.cash;
|
||||
|
||||
@@ -196,7 +196,7 @@ void scenario_begin()
|
||||
gParkRating = calculate_park_rating();
|
||||
gParkValue = calculate_park_value();
|
||||
gCompanyValue = calculate_company_value();
|
||||
RCT2_GLOBAL(0x013587D0, money32) = gInitialCash - gBankLoan;
|
||||
gHistoricalProfit = gInitialCash - gBankLoan;
|
||||
gCashEncrypted = ENCRYPT_MONEY(gInitialCash);
|
||||
|
||||
safe_strcpy(gScenarioDetails, gS6Info->details, 256);
|
||||
|
||||
@@ -255,7 +255,7 @@ typedef struct rct_s6_data {
|
||||
uint32 loan_hash;
|
||||
uint16 ride_count;
|
||||
uint8 pad_013587CA[6];
|
||||
uint32 dword_013587D0;
|
||||
money32 historical_profit;
|
||||
uint8 pad_013587D4[4];
|
||||
char scenario_completed_name[32];
|
||||
money32 cash;
|
||||
|
||||
Reference in New Issue
Block a user