add park_reset_awards_and_history

This commit is contained in:
IntelOrca 2014-05-11 01:18:56 +01:00
parent f8363e098b
commit 70e7660d0b
4 changed files with 32 additions and 2 deletions

View File

@ -153,8 +153,11 @@
#define RCT2_ADDRESS_OBJECTIVE_YEAR 0x013580F9
#define RCT2_ADDRESS_OBJECTIVE_CURRENCY 0x013580FC
#define RCT2_ADDRESS_OBJECTIVE_NUM_GUESTS 0x01358100
#define RCT2_ADDRESS_BALANCE_HISTORY 0x0135812C
#define RCT2_ADDRESS_CURRENT_PROFIT 0x01358330
#define RCT2_ADDRESS_WEEKLY_PROFIT_HISTORY 0x0135833C
#define RCT2_ADDRESS_CURRENT_PARK_VALUE 0x0135853C
#define RCT2_ADDRESS_PARK_VALUE_HISTORY 0x01358540
#define RCT2_ADDRESS_COMPLETED_COMPANY_VALUE 0x01358740
#define RCT2_ADDRESS_TOTAL_ADMISSIONS 0x01358744
#define RCT2_ADDRESS_INCOME_FROM_ADMISSIONS 0x01358748

View File

@ -87,13 +87,39 @@ void park_init()
RCT2_GLOBAL(0x01358772, uint16) = 400;
RCT2_GLOBAL(0x01358774, uint16) = 0;
RCT2_GLOBAL(RCT2_ADDRESS_PARK_FLAGS, uint32) = PARK_FLAGS_11 | PARK_FLAGS_SHOW_REAL_GUEST_NAMES;
RCT2_CALLPROC_EBPSAFE(0x0066729F); // reset history / finance / awards
park_reset_awards_and_history();
rct_s6_info *info = 0x0141F570;
info->name[0] = '\0';
format_string(info->details, STR_NO_DETAILS_YET, NULL);
}
/**
*
* rct2: 0x0066729F
*/
void park_reset_awards_and_history()
{
int i;
// Reset park rating and guests in park history
for (i = 0; i < 32; i++) {
RCT2_ADDRESS(RCT2_ADDRESS_PARK_RATING_HISTORY, uint8)[i] = 255;
RCT2_ADDRESS(RCT2_ADDRESS_GUESTS_IN_PARK_HISTORY, uint8)[i] = 255;
}
// Reset finance history
for (i = 0; i < 128; i++) {
RCT2_ADDRESS(RCT2_ADDRESS_BALANCE_HISTORY, uint32)[i] = 0x80000000;
RCT2_ADDRESS(RCT2_ADDRESS_WEEKLY_PROFIT_HISTORY, uint32)[i] = 0x80000000;
RCT2_ADDRESS(RCT2_ADDRESS_PARK_VALUE_HISTORY, uint32)[i] = 0x80000000;
}
// Reset awards
for (i = 0; i < 4; i++)
RCT2_ADDRESS(RCT2_ADDRESS_AWARD_LIST, rct_award)[i].time = 0;
}
/**
*
* rct2: 0x0066A348

View File

@ -70,6 +70,7 @@ enum {
int park_is_open();
void park_init();
void park_reset_awards_and_history();
int park_calculate_size();
int calculate_park_rating();

View File

@ -512,7 +512,7 @@ void scenario_load_and_play(rct_scenario_basic *scenario)
RCT2_GLOBAL(RCT2_ADDRESS_INCOME_FROM_ADMISSIONS, uint32) = 0;
RCT2_GLOBAL(0x013587D8, uint16) = 63;
RCT2_CALLPROC_EBPSAFE(0x0069E869); // (loan related, called above already)
RCT2_CALLPROC_EBPSAFE(0x0066729F); // reset history / finance / awards
park_reset_awards_and_history();
reset_all_ride_build_dates();
date_reset();
RCT2_CALLPROC_EBPSAFE(0x00674576);