mirror of
https://github.com/OpenRCT2/OpenRCT2
synced 2025-12-23 15:52:55 +01:00
fix award window bug and clean reset history
This commit is contained in:
@@ -568,6 +568,13 @@ static int award_is_deserved(int awardType, int activeAwardTypes)
|
||||
|
||||
#pragma endregion
|
||||
|
||||
void award_reset()
|
||||
{
|
||||
int i;
|
||||
for (i = 0; i < MAX_AWARDS; i++)
|
||||
RCT2_ADDRESS(RCT2_ADDRESS_AWARD_LIST, rct_award)[i].time = 0;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* rct2: 0x0066A86C
|
||||
|
||||
@@ -52,6 +52,7 @@ enum {
|
||||
#define MAX_AWARDS 4
|
||||
|
||||
int award_is_positive(int type);
|
||||
void award_reset();
|
||||
void award_update_all();
|
||||
|
||||
#endif
|
||||
@@ -137,6 +137,15 @@ void finance_pay_ride_upkeep()
|
||||
}
|
||||
}
|
||||
|
||||
void finance_reset_history()
|
||||
{
|
||||
int i;
|
||||
for (i = 0; i < 128; i++) {
|
||||
RCT2_ADDRESS(RCT2_ADDRESS_BALANCE_HISTORY, money32)[i] = MONEY32_UNDEFINED;
|
||||
RCT2_ADDRESS(RCT2_ADDRESS_WEEKLY_PROFIT_HISTORY, money32)[i] = MONEY32_UNDEFINED;
|
||||
RCT2_ADDRESS(RCT2_ADDRESS_PARK_VALUE_HISTORY, money32)[i] = MONEY32_UNDEFINED;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
|
||||
@@ -38,6 +38,7 @@ void finance_pay_wages();
|
||||
void finance_pay_research();
|
||||
void finance_pay_interest();
|
||||
void finance_pay_ride_upkeep();
|
||||
void finance_reset_history();
|
||||
void finance_init();
|
||||
void sub_69E869();
|
||||
|
||||
|
||||
19
src/park.c
19
src/park.c
@@ -104,7 +104,9 @@ 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;
|
||||
park_reset_awards_and_history();
|
||||
park_reset_history();
|
||||
finance_reset_history();
|
||||
award_reset();
|
||||
|
||||
rct_s6_info *info = (rct_s6_info*)0x0141F570;
|
||||
info->name[0] = '\0';
|
||||
@@ -115,26 +117,13 @@ void park_init()
|
||||
*
|
||||
* rct2: 0x0066729F
|
||||
*/
|
||||
void park_reset_awards_and_history()
|
||||
void park_reset_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, money32)[i] = MONEY32_UNDEFINED;
|
||||
RCT2_ADDRESS(RCT2_ADDRESS_WEEKLY_PROFIT_HISTORY, money32)[i] = MONEY32_UNDEFINED;
|
||||
RCT2_ADDRESS(RCT2_ADDRESS_PARK_VALUE_HISTORY, money32)[i] = MONEY32_UNDEFINED;
|
||||
}
|
||||
|
||||
// Reset awards
|
||||
for (i = 0; i < 4; i++)
|
||||
RCT2_ADDRESS(RCT2_ADDRESS_AWARD_LIST, rct_award)[i].time = 0;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -45,7 +45,7 @@ enum {
|
||||
|
||||
int park_is_open();
|
||||
void park_init();
|
||||
void park_reset_awards_and_history();
|
||||
void park_reset_history();
|
||||
int park_calculate_size();
|
||||
|
||||
int calculate_park_rating();
|
||||
|
||||
@@ -279,7 +279,9 @@ void scenario_load_and_play(const rct_scenario_basic *scenario)
|
||||
RCT2_GLOBAL(RCT2_ADDRESS_INCOME_FROM_ADMISSIONS, uint32) = 0;
|
||||
RCT2_GLOBAL(0x013587D8, uint16) = 63;
|
||||
sub_69E869(); // (loan related, called above already)
|
||||
park_reset_awards_and_history();
|
||||
park_reset_history();
|
||||
finance_reset_history();
|
||||
award_reset();
|
||||
reset_all_ride_build_dates();
|
||||
date_reset();
|
||||
RCT2_CALLPROC_EBPSAFE(0x00674576);
|
||||
|
||||
@@ -2259,13 +2259,13 @@ static void window_park_awards_paint()
|
||||
y = w->y + window_park_awards_widgets[WIDX_PAGE_BACKGROUND].top + 4;
|
||||
|
||||
count = 0;
|
||||
for (i = 0; i < 4; i++) {
|
||||
for (i = 0; i < MAX_AWARDS; i++) {
|
||||
award = &RCT2_ADDRESS(RCT2_ADDRESS_AWARD_LIST, rct_award)[i];
|
||||
if (award->time == 0)
|
||||
continue;
|
||||
|
||||
gfx_draw_sprite(dpi, SPR_AWARD_MOST_UNTIDY + award->type, x, y);
|
||||
gfx_draw_string_left_wrapped(dpi, NULL, x + 34, y + 6, 180, STR_AWARD_MOST_UNTIDY, 0);
|
||||
gfx_draw_string_left_wrapped(dpi, NULL, x + 34, y + 6, 180, STR_AWARD_MOST_UNTIDY + award->type, 0);
|
||||
|
||||
y += 32;
|
||||
count++;
|
||||
|
||||
Reference in New Issue
Block a user