mirror of
https://github.com/OpenRCT2/OpenRCT2
synced 2026-01-16 03:23:15 +01:00
Implementing small loan & cheat detection related routine
This commit is contained in:
@@ -149,11 +149,11 @@ void finance_init() {
|
||||
RCT2_GLOBAL(0x01358334, uint32) = 0;
|
||||
RCT2_GLOBAL(0x01358338, uint16) = 0;
|
||||
|
||||
RCT2_GLOBAL(0x013573DC, uint32) = 100000; // Cheat detection
|
||||
RCT2_GLOBAL(0x013573DC, sint32) = 100000; // Cheat detection
|
||||
|
||||
RCT2_GLOBAL(RCT2_ADDRESS_CURRENT_MONEY_ENCRYPTED, sint32) = ENCRYPT_MONEY(100000);
|
||||
RCT2_GLOBAL(RCT2_ADDRESS_CURRENT_LOAN, sint32) = 100000;
|
||||
RCT2_GLOBAL(RCT2_ADDRESS_MAXIMUM_LOAN, uint32) = 200000;
|
||||
RCT2_GLOBAL(RCT2_ADDRESS_MAXIMUM_LOAN, sint32) = 200000;
|
||||
|
||||
RCT2_GLOBAL(0x013587D0, uint32) = 0;
|
||||
|
||||
@@ -166,5 +166,17 @@ void finance_init() {
|
||||
|
||||
RCT2_GLOBAL(0x013587D8, uint16) = 0x3F;
|
||||
|
||||
RCT2_CALLPROC_EBPSAFE(0x0069E869);
|
||||
sub_69E869();
|
||||
}
|
||||
|
||||
void sub_69E869() {
|
||||
// This subroutine is loan related and is used for cheat detection
|
||||
sint32 value = 0x70093A;
|
||||
value -= RCT2_GLOBAL(0x013573DC, sint32); // Cheat detection
|
||||
value = ror32(value, 5);
|
||||
value -= RCT2_GLOBAL(RCT2_ADDRESS_CURRENT_LOAN, sint32);
|
||||
value = ror32(value, 7);
|
||||
value += RCT2_GLOBAL(RCT2_ADDRESS_MAXIMUM_LOAN, sint32);
|
||||
value = ror32(value, 3);
|
||||
RCT2_GLOBAL(0x013587C4, sint32) = value;
|
||||
}
|
||||
@@ -41,5 +41,6 @@ void finance_pay_research();
|
||||
void finance_pay_interest();
|
||||
void finance_pay_ride_upkeep();
|
||||
void finance_init();
|
||||
void sub_69E869();
|
||||
|
||||
#endif
|
||||
@@ -1519,7 +1519,7 @@ int game_load_save()
|
||||
window_new_ride_init_vars();
|
||||
RCT2_GLOBAL(0x009DEB7C, uint16) = 0;
|
||||
if (RCT2_GLOBAL(0x0013587C4, uint32) == 0) // this check is not in scenario play
|
||||
RCT2_CALLPROC_EBPSAFE(0x0069E869);
|
||||
sub_69E869();
|
||||
|
||||
RCT2_CALLPROC_EBPSAFE(0x006837E3); // (palette related)
|
||||
gfx_invalidate_screen();
|
||||
|
||||
@@ -466,7 +466,7 @@ void scenario_load_and_play(rct_scenario_basic *scenario)
|
||||
RCT2_GLOBAL(RCT2_ADDRESS_CURRENT_COMPANY_VALUE, sint16) = calculate_company_value();
|
||||
RCT2_GLOBAL(0x013587D0, sint16) = RCT2_GLOBAL(0x013573DC, sint16) - RCT2_GLOBAL(RCT2_ADDRESS_CURRENT_LOAN, sint16);
|
||||
RCT2_GLOBAL(RCT2_ADDRESS_CURRENT_MONEY_ENCRYPTED, sint32) = ENCRYPT_MONEY(RCT2_GLOBAL(0x013573DC, sint32));
|
||||
RCT2_CALLPROC_EBPSAFE(0x0069E869); // (loan related)
|
||||
sub_69E869(); // (loan related)
|
||||
|
||||
strcpy((char*)RCT2_ADDRESS_SCENARIO_DETAILS, s6Info->details);
|
||||
strcpy((char*)RCT2_ADDRESS_SCENARIO_NAME, s6Info->name);
|
||||
@@ -508,7 +508,7 @@ void scenario_load_and_play(rct_scenario_basic *scenario)
|
||||
RCT2_GLOBAL(RCT2_ADDRESS_TOTAL_ADMISSIONS, uint32) = 0;
|
||||
RCT2_GLOBAL(RCT2_ADDRESS_INCOME_FROM_ADMISSIONS, uint32) = 0;
|
||||
RCT2_GLOBAL(0x013587D8, uint16) = 63;
|
||||
RCT2_CALLPROC_EBPSAFE(0x0069E869); // (loan related, called above already)
|
||||
sub_69E869(); // (loan related, called above already)
|
||||
park_reset_awards_and_history();
|
||||
reset_all_ride_build_dates();
|
||||
date_reset();
|
||||
|
||||
Reference in New Issue
Block a user