From 5d75fa4464439f33862c29b2bcd8269fa7ed57ea Mon Sep 17 00:00:00 2001 From: Rune Laenen Date: Fri, 2 Oct 2015 13:41:13 +0200 Subject: [PATCH] var_2A to outside_of_park --- src/management/award.c | 16 ++++++++-------- src/peep/peep.c | 30 +++++++++++++++--------------- src/peep/peep.h | 2 +- src/peep/staff.c | 2 +- src/windows/guest_list.c | 10 +++++----- src/world/park.c | 2 +- 6 files changed, 31 insertions(+), 31 deletions(-) diff --git a/src/management/award.c b/src/management/award.c index d2ec346818..5bbb728899 100644 --- a/src/management/award.c +++ b/src/management/award.c @@ -76,7 +76,7 @@ static int award_is_deserved_most_untidy(int awardType, int activeAwardTypes) negativeCount = 0; FOR_ALL_GUESTS(spriteIndex, peep) { - if (peep->var_2A != 0) + if (peep->outside_of_park != 0) continue; if (peep->thoughts[0].var_2 > 5) @@ -109,7 +109,7 @@ static int award_is_deserved_most_tidy(int awardType, int activeAwardTypes) positiveCount = 0; negativeCount = 0; FOR_ALL_GUESTS(spriteIndex, peep) { - if (peep->var_2A != 0) + if (peep->outside_of_park != 0) continue; if (peep->thoughts[0].var_2 > 5) @@ -183,7 +183,7 @@ static int award_is_deserved_most_beautiful(int awardType, int activeAwardTypes) positiveCount = 0; negativeCount = 0; FOR_ALL_GUESTS(spriteIndex, peep) { - if (peep->var_2A != 0) + if (peep->outside_of_park != 0) continue; if (peep->thoughts[0].var_2 > 5) @@ -227,7 +227,7 @@ static int award_is_deserved_safest(int awardType, int activeAwardTypes) peepsWhoDislikeVandalism = 0; FOR_ALL_GUESTS(spriteIndex, peep) { - if (peep->var_2A != 0) + if (peep->outside_of_park != 0) continue; if (peep->thoughts[0].var_2 <= 5 && peep->thoughts[0].type == PEEP_THOUGHT_TYPE_VANDALISM) peepsWhoDislikeVandalism++; @@ -307,7 +307,7 @@ static int award_is_deserved_best_food(int awardType, int activeAwardTypes) // Count hungry peeps hungryPeeps = 0; FOR_ALL_GUESTS(spriteIndex, peep) { - if (peep->var_2A != 0) + if (peep->outside_of_park != 0) continue; if (peep->thoughts[0].var_2 <= 5 && peep->thoughts[0].type == PEEP_THOUGHT_TYPE_HUNGRY) @@ -353,7 +353,7 @@ static int award_is_deserved_worst_food(int awardType, int activeAwardTypes) // Count hungry peeps hungryPeeps = 0; FOR_ALL_GUESTS(spriteIndex, peep) { - if (peep->var_2A != 0) + if (peep->outside_of_park != 0) continue; if (peep->thoughts[0].var_2 <= 5 && peep->thoughts[0].type == PEEP_THOUGHT_TYPE_HUNGRY) @@ -388,7 +388,7 @@ static int award_is_deserved_best_restrooms(int awardType, int activeAwardTypes) // Count number of guests who are thinking they need the restroom guestsWhoNeedRestroom = 0; FOR_ALL_GUESTS(spriteIndex, peep) { - if (peep->var_2A != 0) + if (peep->outside_of_park != 0) continue; if (peep->thoughts[0].var_2 <= 5 && peep->thoughts[0].type == PEEP_THOUGHT_TYPE_BATHROOM) @@ -517,7 +517,7 @@ static int award_is_deserved_most_confusing_layout(int awardType, int activeAwar peepsCounted = 0; peepsLost = 0; FOR_ALL_GUESTS(spriteIndex, peep) { - if (peep->var_2A != 0) + if (peep->outside_of_park != 0) continue; peepsCounted++; diff --git a/src/peep/peep.c b/src/peep/peep.c index 749c118c4e..313fa81b24 100644 --- a/src/peep/peep.c +++ b/src/peep/peep.c @@ -305,7 +305,7 @@ static void sub_68F8CD(rct_peep *peep) peep->thirst--; } - if (peep->var_2A != 0) { + if (peep->outside_of_park != 0) { return; } @@ -460,7 +460,7 @@ static void sub_68F41A(rct_peep *peep, int index) } if (peep->state == PEEP_STATE_WALKING && - peep->var_2A == 0 && + peep->outside_of_park == 0 && !(peep->flags & PEEP_FLAGS_LEAVING_PARK) && peep->no_of_rides == 0 && peep->guest_heading_to_ride_id == 0xFF){ @@ -486,7 +486,7 @@ static void sub_68F41A(rct_peep *peep, int index) if ((index & 0x3FF) == (RCT2_GLOBAL(RCT2_ADDRESS_CURRENT_TICKS, uint32) & 0x3FF)){ - if (peep->var_2A == 0 && + if (peep->outside_of_park == 0 && (peep->state == PEEP_STATE_WALKING || peep->state == PEEP_STATE_SITTING)){ uint8 num_thoughts = 0; @@ -1265,7 +1265,7 @@ void peep_sprite_remove(rct_peep* peep){ */ void peep_remove(rct_peep* peep){ if (peep->type == PEEP_TYPE_GUEST){ - if (peep->var_2A == 0){ + if (peep->outside_of_park == 0){ RCT2_GLOBAL(RCT2_ADDRESS_GUESTS_IN_PARK, uint16)--; RCT2_GLOBAL(RCT2_ADDRESS_BTM_TOOLBAR_DIRTY_FLAGS, uint16) |= BTM_TB_DIRTY_FLAG_PEEP_COUNT; } @@ -3630,7 +3630,7 @@ static void peep_update_leaving_park(rct_peep* peep){ return; } - peep->var_2A = 1; + peep->outside_of_park = 1; peep->destination_tolerence = 5; RCT2_GLOBAL(RCT2_ADDRESS_GUESTS_IN_PARK, uint16)--; RCT2_GLOBAL(RCT2_ADDRESS_BTM_TOOLBAR_DIRTY_FLAGS, uint16) |= BTM_TB_DIRTY_FLAG_PEEP_COUNT; @@ -3750,7 +3750,7 @@ static void peep_update_entering_park(rct_peep* peep){ peep->state = PEEP_STATE_FALLING; peep_window_state_update(peep); - peep->var_2A = 0; + peep->outside_of_park = 0; peep->time_in_park = RCT2_GLOBAL(RCT2_ADDRESS_SCENARIO_TICKS, uint32); RCT2_GLOBAL(RCT2_ADDRESS_GUESTS_IN_PARK, uint16)++; RCT2_GLOBAL(RCT2_ADDRESS_GUESTS_HEADING_FOR_PARK, uint16)--; @@ -5024,7 +5024,7 @@ void peep_problem_warnings_update() RCT2_GLOBAL(RCT2_ADDRESS_RIDE_COUNT, sint16) = ride_get_count(); // refactor this to somewhere else FOR_ALL_GUESTS(spriteIndex, peep) { - if (peep->var_2A != 0 || peep->thoughts[0].var_2 > 5) + if (peep->outside_of_park != 0 || peep->thoughts[0].var_2 > 5) continue; switch (peep->thoughts[0].type) { @@ -5232,7 +5232,7 @@ void peep_applause() rct_peep* peep; FOR_ALL_GUESTS(spriteIndex, peep) { - if (peep->var_2A != 0) + if (peep->outside_of_park != 0) continue; // Release balloon @@ -5269,7 +5269,7 @@ void peep_update_days_in_queue() rct_peep *peep; FOR_ALL_GUESTS(sprite_index, peep) { - if (peep->var_2A == 0 && peep->state == PEEP_STATE_QUEUING) { + if (peep->outside_of_park == 0 && peep->state == PEEP_STATE_QUEUING) { if (peep->days_in_queue < 255) { peep->days_in_queue += 1; } @@ -5292,7 +5292,7 @@ rct_peep *peep_generate(int x, int y, int z) peep->sprite_identifier = 1; peep->sprite_type = PEEP_SPRITE_TYPE_NORMAL; - peep->var_2A = 1; + peep->outside_of_park = 1; peep->state = PEEP_STATE_FALLING; peep->action = PEEP_ACTION_NONE_2; peep->var_6D = 0; @@ -6426,11 +6426,11 @@ static int peep_interact_with_path(rct_peep* peep, sint16 x, sint16 y, rct_map_e sint16 z = map_element->base_height * 8; if (!map_is_location_owned(x, y, z)){ - if (peep->var_2A == 0) + if (peep->outside_of_park == 0) return peep_return_to_center_of_tile(peep); } else{ - if (peep->var_2A == 1) + if (peep->outside_of_park == 1) return peep_return_to_center_of_tile(peep); } @@ -7214,7 +7214,7 @@ static int guest_path_finding(rct_peep* peep) } uint8 edges = path_get_permitted_edges(mapElement); - if (peep->var_2A == 0 && peep_heading_for_ride_or_park_exit(peep)) { + if (peep->outside_of_park == 0 && peep_heading_for_ride_or_park_exit(peep)) { uint8 adjustedEdges = edges; for (int chosenDirection = 0; chosenDirection < 4; chosenDirection++) { // If there is no path in that direction try another @@ -7249,7 +7249,7 @@ static int guest_path_finding(rct_peep* peep) } // loc_694F19: - if (peep->var_2A != 0){ + if (peep->outside_of_park != 0){ switch (peep->state) { case PEEP_STATE_ENTERING_PARK: return guest_path_find_entering_park(peep, mapElement, edges); @@ -7423,7 +7423,7 @@ static int sub_693C9E(rct_peep *peep) } if (x < 32 || y < 32 || x >= RCT2_GLOBAL(RCT2_ADDRESS_MAP_SIZE_UNITS, uint16) || y >= RCT2_GLOBAL(RCT2_ADDRESS_MAP_SIZE_UNITS, uint16)){ - if (peep->var_2A == 1){ + if (peep->outside_of_park == 1){ RCT2_GLOBAL(0x00F1EE18, uint16) |= (1 << 1); } return peep_return_to_center_of_tile(peep); diff --git a/src/peep/peep.h b/src/peep/peep.h index dcaa8b12d3..b270f3c456 100644 --- a/src/peep/peep.h +++ b/src/peep/peep.h @@ -402,7 +402,7 @@ typedef struct { uint16 next_y; // 0x26 uint8 next_z; // 0x28 uint8 next_var_29; // 0x29 - uint8 var_2A; + uint8 outside_of_park; uint8 state; // 0x2B uint8 sub_state; // 0x2C uint8 sprite_type; // 0x2D diff --git a/src/peep/staff.c b/src/peep/staff.c index 270d6c5e62..71cf4d2da5 100644 --- a/src/peep/staff.c +++ b/src/peep/staff.c @@ -135,7 +135,7 @@ void game_command_hire_new_staff_member(int* eax, int* ebx, int* ecx, int* edx, newPeep->action_sprite_type = 0; newPeep->var_C4 = 0; newPeep->type = PEEP_TYPE_STAFF; - newPeep->var_2A = 0; + newpeep->outside_of_park = 0; newPeep->flags = 0; newPeep->paid_to_enter = 0; newPeep->paid_on_rides = 0; diff --git a/src/windows/guest_list.c b/src/windows/guest_list.c index 63cb9d2a97..6a42012c46 100644 --- a/src/windows/guest_list.c +++ b/src/windows/guest_list.c @@ -428,7 +428,7 @@ static void window_guest_list_scrollgetsize(rct_window *w, int scrollIndex, int numGuests = 0; FOR_ALL_GUESTS(spriteIndex, peep) { - if (peep->var_2A != 0) + if (peep->outside_of_park != 0) continue; if (_window_guest_list_selected_filter != -1) if (window_guest_list_is_peep_in_filter(peep)) @@ -487,7 +487,7 @@ static void window_guest_list_scrollmousedown(rct_window *w, int scrollIndex, in i = y / 10; i += _window_guest_list_selected_page * 3173; FOR_ALL_GUESTS(spriteIndex, peep) { - if (peep->var_2A != 0) + if (peep->outside_of_park != 0) continue; if (_window_guest_list_selected_filter != -1) if (window_guest_list_is_peep_in_filter(peep)) @@ -653,7 +653,7 @@ static void window_guest_list_scrollpaint(rct_window *w, rct_drawpixelinfo *dpi, // For each guest FOR_ALL_GUESTS(spriteIndex, peep) { peep->var_0C &= ~0x200; - if (peep->var_2A != 0) + if (peep->outside_of_park != 0) continue; if (_window_guest_list_selected_filter != -1) { if (window_guest_list_is_peep_in_filter(peep)) @@ -837,12 +837,12 @@ static void window_guest_list_find_groups() // Set all guests to unassigned FOR_ALL_GUESTS(spriteIndex, peep) - if (peep->var_2A == 0) + if (peep->outside_of_park == 0) peep->var_0C |= (1 << 8); // For each guest / group FOR_ALL_GUESTS(spriteIndex, peep) { - if (peep->var_2A != 0 || !(peep->var_0C & (1 << 8))) + if (peep->outside_of_park != 0 || !(peep->var_0C & (1 << 8))) continue; // New group, cap at 240 though diff --git a/src/world/park.c b/src/world/park.c index 27f3fb5cfd..00f51de222 100644 --- a/src/world/park.c +++ b/src/world/park.c @@ -187,7 +187,7 @@ int calculate_park_rating() num_happy_peeps = 0; _bp = 0; FOR_ALL_GUESTS(spriteIndex, peep) { - if (peep->var_2A != 0) + if (peep->outside_of_park != 0) continue; if (peep->happiness > 128) num_happy_peeps++;