diff --git a/src/openrct2-ui/windows/Staff.cpp b/src/openrct2-ui/windows/Staff.cpp index 19c1f6109a..f8e92d73ad 100644 --- a/src/openrct2-ui/windows/Staff.cpp +++ b/src/openrct2-ui/windows/Staff.cpp @@ -570,7 +570,7 @@ void window_staff_overview_mousedown(rct_window* w, rct_widgetindex widgetIndex, Peep* peep = GET_PEEP(w->number); // Disable clear patrol area if no area is set. - if (!(gStaffModes[peep->staff_id] & 2)) + if (!(gStaffModes[peep->StaffId] & 2)) { dropdown_set_disabled(1, true); } @@ -593,9 +593,9 @@ void window_staff_overview_dropdown(rct_window* w, rct_widgetindex widgetIndex, Peep* peep = GET_PEEP(w->number); for (int32_t i = 0; i < STAFF_PATROL_AREA_SIZE; i++) { - gStaffPatrolAreas[peep->staff_id * STAFF_PATROL_AREA_SIZE + i] = 0; + gStaffPatrolAreas[peep->StaffId * STAFF_PATROL_AREA_SIZE + i] = 0; } - gStaffModes[peep->staff_id] &= ~2; + gStaffModes[peep->StaffId] &= ~2; gfx_invalidate_screen(); staff_update_greyed_patrol_areas(); diff --git a/src/openrct2-ui/windows/StaffList.cpp b/src/openrct2-ui/windows/StaffList.cpp index 92739b2ee6..e9ee701343 100644 --- a/src/openrct2-ui/windows/StaffList.cpp +++ b/src/openrct2-ui/windows/StaffList.cpp @@ -386,7 +386,7 @@ static void window_staff_list_tooldown(rct_window* w, rct_widgetindex widgetInde if (isPatrolAreaSet) { - if (!(gStaffModes[peep->staff_id] & 2)) + if (!(gStaffModes[peep->StaffId] & 2)) { continue; } @@ -707,7 +707,7 @@ void window_staff_list_scrollpaint(rct_window* w, rct_drawpixelinfo* dpi, int32_ gfx_draw_string_left_clipped(dpi, format, gCommonFormatArgs, COLOUR_BLACK, { actionOffset, y }, actionColumnSize); // True if a patrol path is set for the worker - if (gStaffModes[peep->staff_id] & 2) + if (gStaffModes[peep->StaffId] & 2) { gfx_draw_sprite(dpi, SPR_STAFF_PATROL_PATH, nameColumnSize + 5, y, 0); } diff --git a/src/openrct2/actions/StaffHireNewAction.hpp b/src/openrct2/actions/StaffHireNewAction.hpp index 91ec306801..99832a298a 100644 --- a/src/openrct2/actions/StaffHireNewAction.hpp +++ b/src/openrct2/actions/StaffHireNewAction.hpp @@ -246,7 +246,7 @@ private: newPeep->energy_target = 0x60; newPeep->StaffMowingTimeout = 0; - newPeep->staff_id = staffIndex; + newPeep->StaffId = staffIndex; gStaffModes[staffIndex] = STAFF_MODE_WALK; diff --git a/src/openrct2/actions/StaffSetPatrolAreaAction.hpp b/src/openrct2/actions/StaffSetPatrolAreaAction.hpp index cc2ec3fac1..22d113461e 100644 --- a/src/openrct2/actions/StaffSetPatrolAreaAction.hpp +++ b/src/openrct2/actions/StaffSetPatrolAreaAction.hpp @@ -69,9 +69,9 @@ public: return MakeResult(GA_ERROR::INVALID_PARAMETERS, STR_NONE); } - int32_t patrolOffset = peep->staff_id * STAFF_PATROL_AREA_SIZE; + int32_t patrolOffset = peep->StaffId * STAFF_PATROL_AREA_SIZE; - staff_toggle_patrol_area(peep->staff_id, _loc.x, _loc.y); + staff_toggle_patrol_area(peep->StaffId, _loc.x, _loc.y); bool isPatrolling = false; for (int32_t i = 0; i < 128; i++) @@ -83,10 +83,10 @@ public: } } - gStaffModes[peep->staff_id] &= ~(1 << 1); + gStaffModes[peep->StaffId] &= ~(1 << 1); if (isPatrolling) { - gStaffModes[peep->staff_id] |= (1 << 1); + gStaffModes[peep->StaffId] |= (1 << 1); } for (int32_t y = 0; y < 4 * COORDS_XY_STEP; y += COORDS_XY_STEP) diff --git a/src/openrct2/peep/Peep.cpp b/src/openrct2/peep/Peep.cpp index efab02d193..f5b31dee6d 100644 --- a/src/openrct2/peep/Peep.cpp +++ b/src/openrct2/peep/Peep.cpp @@ -848,7 +848,7 @@ void peep_sprite_remove(Peep* peep) { window_invalidate_by_class(WC_STAFF_LIST); - gStaffModes[peep->staff_id] = 0; + gStaffModes[peep->StaffId] = 0; peep->type = PEEP_TYPE_INVALID; staff_update_greyed_patrol_areas(); peep->type = PEEP_TYPE_STAFF; diff --git a/src/openrct2/peep/Peep.h b/src/openrct2/peep/Peep.h index 86aaacf156..5c86182cfe 100644 --- a/src/openrct2/peep/Peep.h +++ b/src/openrct2/peep/Peep.h @@ -688,7 +688,7 @@ struct Peep : SpriteBase uint8_t path_check_optimisation; // see peep.checkForPath union { - uint8_t staff_id; + uint8_t StaffId; uint8_t GuestHeadingToRideId; }; union diff --git a/src/openrct2/peep/Staff.cpp b/src/openrct2/peep/Staff.cpp index 839051a5ff..dc3cf382f9 100644 --- a/src/openrct2/peep/Staff.cpp +++ b/src/openrct2/peep/Staff.cpp @@ -70,7 +70,7 @@ const rct_string_id StaffCostumeNames[] = { }; // clang-format on -// Every staff member has STAFF_PATROL_AREA_SIZE elements assigned to in this array, indexed by their staff_id +// Every staff member has STAFF_PATROL_AREA_SIZE elements assigned to in this array, indexed by their StaffId // Additionally there is a patrol area for each staff type, which is the union of the patrols of all staff members of that type uint32_t gStaffPatrolAreas[(STAFF_MAX_COUNT + STAFF_TYPE_COUNT) * STAFF_PATROL_AREA_SIZE]; uint8_t gStaffModes[STAFF_MAX_COUNT + STAFF_TYPE_COUNT]; @@ -157,7 +157,7 @@ void staff_update_greyed_patrol_areas() { if (peep->staff_type == staff_type) { - int32_t peepPatrolOffset = peep->staff_id * STAFF_PATROL_AREA_SIZE; + int32_t peepPatrolOffset = peep->StaffId * STAFF_PATROL_AREA_SIZE; for (int32_t i = 0; i < STAFF_PATROL_AREA_SIZE; i++) { gStaffPatrolAreas[staffPatrolOffset + i] |= gStaffPatrolAreas[peepPatrolOffset + i]; @@ -178,7 +178,7 @@ bool Staff::IsLocationInPatrol(const CoordsXY& loc) const return false; // Check if staff has patrol area - if (!(gStaffModes[staff_id] & 2)) + if (!(gStaffModes[StaffId] & 2)) return true; return IsPatrolAreaSet(loc); @@ -395,7 +395,7 @@ static bool staff_is_patrol_area_set(int32_t staffIndex, int32_t x, int32_t y) bool Staff::IsPatrolAreaSet(const CoordsXY& coords) const { - return staff_is_patrol_area_set(staff_id, coords.x, coords.y); + return staff_is_patrol_area_set(StaffId, coords.x, coords.y); } bool staff_is_patrol_area_set_for_type(STAFF_TYPE type, const CoordsXY& coords) diff --git a/src/openrct2/rct1/S4Importer.cpp b/src/openrct2/rct1/S4Importer.cpp index c0113add8a..385ee25fc2 100644 --- a/src/openrct2/rct1/S4Importer.cpp +++ b/src/openrct2/rct1/S4Importer.cpp @@ -1596,7 +1596,7 @@ private: // index in the array ----^ ^--- bit position in the 8-bit value // We do the opposite in this function to recover the x and y values. - int32_t peepOffset = staffmember->staff_id * RCT12_PATROL_AREA_SIZE; + int32_t peepOffset = staffmember->StaffId * RCT12_PATROL_AREA_SIZE; for (int32_t i = 0; i < RCT12_PATROL_AREA_SIZE; i++) { if (_s4.patrol_areas[peepOffset + i] == 0) @@ -1620,7 +1620,7 @@ private: x <<= 7; int32_t y = val & 0x3E0; y <<= 2; - staff_set_patrol_area(staffmember->staff_id, x, y, true); + staff_set_patrol_area(staffmember->StaffId, x, y, true); } } }