diff --git a/src/openrct2-ui/windows/GameBottomToolbar.cpp b/src/openrct2-ui/windows/GameBottomToolbar.cpp index 9347d09385..5c7cad660e 100644 --- a/src/openrct2-ui/windows/GameBottomToolbar.cpp +++ b/src/openrct2-ui/windows/GameBottomToolbar.cpp @@ -613,7 +613,7 @@ static void window_game_bottom_toolbar_draw_news_item(rct_drawpixelinfo* dpi, rc auto clipCoords = ScreenCoordsXY{ 10, 19 }; - if (peep->AssignedPeepType == PeepType::Staff && peep->StaffType == STAFF_TYPE_ENTERTAINER) + if (peep->AssignedPeepType == PeepType::Staff && peep->AssignedStaffType == STAFF_TYPE_ENTERTAINER) { clipCoords.y += 3; } diff --git a/src/openrct2-ui/windows/Guest.cpp b/src/openrct2-ui/windows/Guest.cpp index 51d9e876dc..7ce43f46e1 100644 --- a/src/openrct2-ui/windows/Guest.cpp +++ b/src/openrct2-ui/windows/Guest.cpp @@ -908,7 +908,7 @@ static void window_guest_overview_tab_paint(rct_window* w, rct_drawpixelinfo* dp return; } - if (peep->AssignedPeepType == PeepType::Staff && peep->StaffType == STAFF_TYPE_ENTERTAINER) + if (peep->AssignedPeepType == PeepType::Staff && peep->AssignedStaffType == STAFF_TYPE_ENTERTAINER) screenCoords.y++; int32_t animationFrame = g_peep_animation_entries[peep->SpriteType].sprite_animation->base_image + 1; diff --git a/src/openrct2-ui/windows/News.cpp b/src/openrct2-ui/windows/News.cpp index d0a6bb8542..6de4eab4a1 100644 --- a/src/openrct2-ui/windows/News.cpp +++ b/src/openrct2-ui/windows/News.cpp @@ -309,7 +309,7 @@ static void window_news_scrollpaint(rct_window* w, rct_drawpixelinfo* dpi, int32 if (peep->AssignedPeepType == PeepType::Staff) { sprite_type = peep->SpriteType; - if (peep->StaffType == STAFF_TYPE_ENTERTAINER) + if (peep->AssignedStaffType == STAFF_TYPE_ENTERTAINER) { clipCoords.y += 3; } diff --git a/src/openrct2-ui/windows/Ride.cpp b/src/openrct2-ui/windows/Ride.cpp index 6bc0e3dd57..1da96edca8 100644 --- a/src/openrct2-ui/windows/Ride.cpp +++ b/src/openrct2-ui/windows/Ride.cpp @@ -4264,7 +4264,7 @@ static void window_ride_maintenance_paint(rct_window* w, rct_drawpixelinfo* dpi) for (auto peep : EntityList(EntityListId::Peep)) { - if (peep->StaffType == STAFF_TYPE_MECHANIC) + if (peep->AssignedStaffType == STAFF_TYPE_MECHANIC) { stringId = STR_CALLING_MECHANIC; break; diff --git a/src/openrct2-ui/windows/Staff.cpp b/src/openrct2-ui/windows/Staff.cpp index 5ab296bdf5..bf58e10b91 100644 --- a/src/openrct2-ui/windows/Staff.cpp +++ b/src/openrct2-ui/windows/Staff.cpp @@ -359,7 +359,7 @@ void window_staff_disable_widgets(rct_window* w) } uint64_t disabled_widgets = 0; - if (peep != nullptr && peep->StaffType == STAFF_TYPE_SECURITY) + if (peep != nullptr && peep->AssignedStaffType == STAFF_TYPE_SECURITY) { disabled_widgets |= (1 << WIDX_TAB_2); } @@ -848,7 +848,7 @@ void window_staff_options_invalidate(rct_window* w) auto ft = Formatter::Common(); peep->FormatNameTo(ft); - switch (peep->StaffType) + switch (peep->AssignedStaffType) { case STAFF_TYPE_ENTERTAINER: window_staff_options_widgets[WIDX_CHECKBOX_1].type = WWT_EMPTY; @@ -1073,7 +1073,7 @@ void window_staff_overview_tab_paint(rct_window* w, rct_drawpixelinfo* dpi) return; } - if (peep->AssignedPeepType == PeepType::Staff && peep->StaffType == STAFF_TYPE_ENTERTAINER) + if (peep->AssignedPeepType == PeepType::Staff && peep->AssignedStaffType == STAFF_TYPE_ENTERTAINER) screenCoords.y++; int32_t ebx = g_peep_animation_entries[peep->SpriteType].sprite_animation->base_image + 1; @@ -1149,7 +1149,7 @@ void window_staff_stats_paint(rct_window* w, rct_drawpixelinfo* dpi) if (!(gParkFlags & PARK_FLAGS_NO_MONEY)) { - Formatter::Common().Add(gStaffWageTable[peep->StaffType]); + Formatter::Common().Add(gStaffWageTable[peep->AssignedStaffType]); gfx_draw_string_left(dpi, STR_STAFF_STAT_WAGES, gCommonFormatArgs, COLOUR_BLACK, screenCoords); screenCoords.y += LIST_ROW_HEIGHT; } @@ -1157,7 +1157,7 @@ void window_staff_stats_paint(rct_window* w, rct_drawpixelinfo* dpi) gfx_draw_string_left(dpi, STR_STAFF_STAT_EMPLOYED_FOR, static_cast(&peep->TimeInPark), COLOUR_BLACK, screenCoords); screenCoords.y += LIST_ROW_HEIGHT; - switch (peep->StaffType) + switch (peep->AssignedStaffType) { case STAFF_TYPE_HANDYMAN: gfx_draw_string_left( diff --git a/src/openrct2-ui/windows/StaffList.cpp b/src/openrct2-ui/windows/StaffList.cpp index a75782560a..dbd568e486 100644 --- a/src/openrct2-ui/windows/StaffList.cpp +++ b/src/openrct2-ui/windows/StaffList.cpp @@ -192,7 +192,7 @@ void WindowStaffListRefresh() for (auto peep : EntityList(EntityListId::Peep)) { sprite_set_flashing(peep, false); - if (peep->StaffType != _windowStaffListSelectedTab) + if (peep->AssignedStaffType != _windowStaffListSelectedTab) continue; sprite_set_flashing(peep, true); @@ -342,7 +342,7 @@ void window_staff_list_update(rct_window* w) { sprite_set_flashing(peep, false); - if (peep->StaffType == _windowStaffListSelectedTab) + if (peep->AssignedStaffType == _windowStaffListSelectedTab) { sprite_set_flashing(peep, true); } @@ -378,7 +378,7 @@ static void window_staff_list_tooldown(rct_window* w, rct_widgetindex widgetInde for (auto peep : EntityList(EntityListId::Peep)) { - if (peep->StaffType != selectedPeepType) + if (peep->AssignedStaffType != selectedPeepType) continue; if (isPatrolAreaSet) @@ -726,7 +726,7 @@ void window_staff_list_scrollpaint(rct_window* w, rct_drawpixelinfo* dpi, int32_ } auto staffOrderIcon_x = nameColumnSize + 20; - if (peep->StaffType != 3) + if (peep->AssignedStaffType != 3) { auto staffOrders = peep->StaffOrders; auto staffOrderSprite = staffOrderBaseSprites[_windowStaffListSelectedTab]; diff --git a/src/openrct2/actions/StaffHireNewAction.hpp b/src/openrct2/actions/StaffHireNewAction.hpp index ace7a49ccf..dc6967c9ac 100644 --- a/src/openrct2/actions/StaffHireNewAction.hpp +++ b/src/openrct2/actions/StaffHireNewAction.hpp @@ -184,7 +184,7 @@ private: ++newStaffId; for (auto searchPeep : EntityList(EntityListId::Peep)) { - if (searchPeep->StaffType != _staffType) + if (searchPeep->AssignedStaffType != _staffType) continue; if (searchPeep->Id == newStaffId) @@ -199,7 +199,7 @@ private: } newPeep->Id = newStaffId; - newPeep->StaffType = _staffType; + newPeep->AssignedStaffType = _staffType; PeepSpriteType spriteType = spriteTypes[_staffType]; if (_staffType == STAFF_TYPE_ENTERTAINER) diff --git a/src/openrct2/actions/StaffSetColourAction.hpp b/src/openrct2/actions/StaffSetColourAction.hpp index 77394f75c0..8f5fee5e01 100644 --- a/src/openrct2/actions/StaffSetColourAction.hpp +++ b/src/openrct2/actions/StaffSetColourAction.hpp @@ -67,7 +67,7 @@ public: // Update each staff member's uniform for (auto peep : EntityList(EntityListId::Peep)) { - if (peep->StaffType == _staffType) + if (peep->AssignedStaffType == _staffType) { peep->TshirtColour = _colour; peep->TrousersColour = _colour; diff --git a/src/openrct2/actions/StaffSetOrdersAction.hpp b/src/openrct2/actions/StaffSetOrdersAction.hpp index 63167a1fcb..e025682f6a 100644 --- a/src/openrct2/actions/StaffSetOrdersAction.hpp +++ b/src/openrct2/actions/StaffSetOrdersAction.hpp @@ -54,7 +54,7 @@ public: } auto* staff = TryGetEntity(_spriteIndex); - if (staff == nullptr || (staff->StaffType != STAFF_TYPE_HANDYMAN && staff->StaffType != STAFF_TYPE_MECHANIC)) + if (staff == nullptr || (staff->AssignedStaffType != STAFF_TYPE_HANDYMAN && staff->AssignedStaffType != STAFF_TYPE_MECHANIC)) { log_warning("Invalid game command for sprite %u", _spriteIndex); return std::make_unique(GA_ERROR::INVALID_PARAMETERS, STR_NONE); diff --git a/src/openrct2/interface/InteractiveConsole.cpp b/src/openrct2/interface/InteractiveConsole.cpp index 76d4057614..f2e4ef11ca 100644 --- a/src/openrct2/interface/InteractiveConsole.cpp +++ b/src/openrct2/interface/InteractiveConsole.cpp @@ -439,7 +439,7 @@ static int32_t cc_staff(InteractiveConsole& console, const arguments_t& argv) { auto name = peep->GetName(); console.WriteFormatLine( - "staff id %03d type: %02u energy %03u name %s", peep->sprite_index, peep->StaffType, peep->Energy, + "staff id %03d type: %02u energy %03u name %s", peep->sprite_index, peep->AssignedStaffType, peep->Energy, name.c_str()); } } @@ -494,7 +494,7 @@ static int32_t cc_staff(InteractiveConsole& console, const arguments_t& argv) console.WriteLineError("Invalid staff ID"); return 1; } - if (staff->StaffType != STAFF_TYPE_ENTERTAINER) + if (staff->AssignedStaffType != STAFF_TYPE_ENTERTAINER) { console.WriteLineError("Specified staff is not entertainer"); return 1; diff --git a/src/openrct2/management/Award.cpp b/src/openrct2/management/Award.cpp index c257d15431..d6ae94aae8 100644 --- a/src/openrct2/management/Award.cpp +++ b/src/openrct2/management/Award.cpp @@ -273,7 +273,7 @@ static bool award_is_deserved_best_staff(int32_t activeAwardTypes) if (peep->AssignedPeepType == PeepType::Staff) { staffCount++; - staffTypeFlags |= (1 << peep->StaffType); + staffTypeFlags |= (1 << peep->AssignedStaffType); } else { diff --git a/src/openrct2/management/Finance.cpp b/src/openrct2/management/Finance.cpp index eb19b17709..e20523914f 100644 --- a/src/openrct2/management/Finance.cpp +++ b/src/openrct2/management/Finance.cpp @@ -113,7 +113,7 @@ void finance_pay_wages() for (auto peep : EntityList(EntityListId::Peep)) { - finance_payment(gStaffWageTable[peep->StaffType] / 4, ExpenditureType::Wages); + finance_payment(gStaffWageTable[peep->AssignedStaffType] / 4, ExpenditureType::Wages); } } @@ -248,7 +248,7 @@ void finance_update_daily_profit() // Staff costs for (auto peep : EntityList(EntityListId::Peep)) { - current_profit -= gStaffWageTable[peep->StaffType]; + current_profit -= gStaffWageTable[peep->AssignedStaffType]; } // Research costs diff --git a/src/openrct2/paint/sprite/Paint.Sprite.cpp b/src/openrct2/paint/sprite/Paint.Sprite.cpp index fbd06db7a6..fa5d967f88 100644 --- a/src/openrct2/paint/sprite/Paint.Sprite.cpp +++ b/src/openrct2/paint/sprite/Paint.Sprite.cpp @@ -50,7 +50,7 @@ void sprite_paint_setup(paint_session* session, const uint16_t x, const uint16_t const auto peep = spr->As(); if (peep != nullptr) { - if (!(peep->AssignedPeepType == PeepType::Staff && peep->StaffType == STAFF_TYPE_HANDYMAN)) + if (!(peep->AssignedPeepType == PeepType::Staff && peep->AssignedStaffType == STAFF_TYPE_HANDYMAN)) { continue; } diff --git a/src/openrct2/paint/tile_element/Paint.Path.cpp b/src/openrct2/paint/tile_element/Paint.Path.cpp index a237bbbc54..fef8b478b4 100644 --- a/src/openrct2/paint/tile_element/Paint.Path.cpp +++ b/src/openrct2/paint/tile_element/Paint.Path.cpp @@ -912,7 +912,7 @@ void path_paint(paint_session* session, uint16_t height, const TileElement* tile { patrolColour = COLOUR_GREY; } - staffType = staff->StaffType; + staffType = staff->AssignedStaffType; } } diff --git a/src/openrct2/paint/tile_element/Paint.Surface.cpp b/src/openrct2/paint/tile_element/Paint.Surface.cpp index d50fb5cfc7..5635ffc15f 100644 --- a/src/openrct2/paint/tile_element/Paint.Surface.cpp +++ b/src/openrct2/paint/tile_element/Paint.Surface.cpp @@ -1095,7 +1095,7 @@ void surface_paint(paint_session* session, uint8_t direction, uint16_t height, c { patrolColour = COLOUR_GREY; } - staffType = staff->StaffType; + staffType = staff->AssignedStaffType; } } diff --git a/src/openrct2/peep/Guest.cpp b/src/openrct2/peep/Guest.cpp index d60b44304d..4d16759557 100644 --- a/src/openrct2/peep/Guest.cpp +++ b/src/openrct2/peep/Guest.cpp @@ -6277,7 +6277,7 @@ static void peep_update_walking_break_scenery(Peep* peep) for (auto inner_peep : EntityList(EntityListId::Peep)) { - if (inner_peep->StaffType != STAFF_TYPE_SECURITY) + if (inner_peep->AssignedStaffType != STAFF_TYPE_SECURITY) continue; if (inner_peep->x == LOCATION_NULL) diff --git a/src/openrct2/peep/GuestPathfinding.cpp b/src/openrct2/peep/GuestPathfinding.cpp index 803bbeba41..f479dccbb9 100644 --- a/src/openrct2/peep/GuestPathfinding.cpp +++ b/src/openrct2/peep/GuestPathfinding.cpp @@ -625,7 +625,7 @@ static void peep_pathfind_heuristic_search( } bool nextInPatrolArea = inPatrolArea; - if (peep->AssignedPeepType == PeepType::Staff && peep->StaffType == STAFF_TYPE_MECHANIC) + if (peep->AssignedPeepType == PeepType::Staff && peep->AssignedStaffType == STAFF_TYPE_MECHANIC) { nextInPatrolArea = peep->AsStaff()->IsLocationInPatrol(loc.ToCoordsXY()); if (inPatrolArea && !nextInPatrolArea) @@ -1400,7 +1400,7 @@ Direction peep_pathfind_choose_direction(const TileCoordsXYZ& loc, Peep* peep) uint8_t endDirectionList[16] = { 0 }; bool inPatrolArea = false; - if (peep->AssignedPeepType == PeepType::Staff && peep->StaffType == STAFF_TYPE_MECHANIC) + if (peep->AssignedPeepType == PeepType::Staff && peep->AssignedStaffType == STAFF_TYPE_MECHANIC) { /* Mechanics are the only staff type that * pathfind to a destination. Determine if the diff --git a/src/openrct2/peep/Peep.cpp b/src/openrct2/peep/Peep.cpp index f6aeba7951..41f6b7b841 100644 --- a/src/openrct2/peep/Peep.cpp +++ b/src/openrct2/peep/Peep.cpp @@ -1940,7 +1940,7 @@ void Peep::FormatNameTo(Formatter& ft) const STR_ENTERTAINER_X, }; - auto staffNameIndex = StaffType; + auto staffNameIndex = AssignedStaffType; if (staffNameIndex > sizeof(staffNames)) { staffNameIndex = 0; diff --git a/src/openrct2/peep/Peep.h b/src/openrct2/peep/Peep.h index e0a7b9a6fe..934b221ece 100644 --- a/src/openrct2/peep/Peep.h +++ b/src/openrct2/peep/Peep.h @@ -609,7 +609,7 @@ struct Peep : SpriteBase PeepType AssignedPeepType; union { - uint8_t StaffType; + uint8_t AssignedStaffType; uint8_t GuestNumRides; }; uint8_t TshirtColour; diff --git a/src/openrct2/peep/Staff.cpp b/src/openrct2/peep/Staff.cpp index 766b30d8d4..56d4ef0f84 100644 --- a/src/openrct2/peep/Staff.cpp +++ b/src/openrct2/peep/Staff.cpp @@ -158,7 +158,7 @@ void staff_update_greyed_patrol_areas() for (auto peep : EntityList(EntityListId::Peep)) { - if (peep->StaffType == staff_type) + if (peep->AssignedStaffType == staff_type) { int32_t peepPatrolOffset = peep->StaffId * STAFF_PATROL_AREA_SIZE; for (int32_t i = 0; i < STAFF_PATROL_AREA_SIZE; i++) @@ -1073,7 +1073,7 @@ bool Staff::DoEntertainerPathFinding() */ bool Staff::DoPathFinding() { - switch (StaffType) + switch (AssignedStaffType) { case STAFF_TYPE_HANDYMAN: return DoHandymanPathFinding(); @@ -1828,7 +1828,7 @@ static int32_t peep_update_patrolling_find_sweeping(Peep* peep) void Staff::Tick128UpdateStaff() { - if (StaffType != STAFF_TYPE_SECURITY) + if (AssignedStaffType != STAFF_TYPE_SECURITY) return; PeepSpriteType newSpriteType = PEEP_SPRITE_TYPE_SECURITY_ALT; @@ -1857,7 +1857,7 @@ void Staff::Tick128UpdateStaff() bool Staff::IsMechanic() const { return ( - sprite_identifier == SPRITE_IDENTIFIER_PEEP && AssignedPeepType == PeepType::Staff && StaffType == STAFF_TYPE_MECHANIC); + sprite_identifier == SPRITE_IDENTIFIER_PEEP && AssignedPeepType == PeepType::Staff && AssignedStaffType == STAFF_TYPE_MECHANIC); } void Staff::UpdateStaff(uint32_t stepsToTake) @@ -1928,7 +1928,7 @@ void Staff::UpdatePatrolling() } } - if (StaffType != STAFF_TYPE_HANDYMAN) + if (AssignedStaffType != STAFF_TYPE_HANDYMAN) return; if (peep_update_patrolling_find_sweeping(this)) diff --git a/src/openrct2/rct2/S6Exporter.cpp b/src/openrct2/rct2/S6Exporter.cpp index 8d14097cd5..02553896a4 100644 --- a/src/openrct2/rct2/S6Exporter.cpp +++ b/src/openrct2/rct2/S6Exporter.cpp @@ -1124,7 +1124,7 @@ void S6Exporter::ExportSpritePeep(RCT2SpritePeep* dst, const Peep* src) STR_SECURITY_GUARD_X, STR_ENTERTAINER_X, }; - dst->name_string_idx = staffNames[src->StaffType % sizeof(staffNames)]; + dst->name_string_idx = staffNames[src->AssignedStaffType % sizeof(staffNames)]; } else if (gParkFlags & PARK_FLAGS_SHOW_REAL_GUEST_NAMES) { diff --git a/src/openrct2/ride/Ride.cpp b/src/openrct2/ride/Ride.cpp index de83e3ccbd..1eaef1b471 100644 --- a/src/openrct2/ride/Ride.cpp +++ b/src/openrct2/ride/Ride.cpp @@ -2700,7 +2700,7 @@ Peep* find_closest_mechanic(const CoordsXY& entrancePosition, int32_t forInspect for (auto peep : EntityList(EntityListId::Peep)) { - if (peep->StaffType != STAFF_TYPE_MECHANIC) + if (peep->AssignedStaffType != STAFF_TYPE_MECHANIC) continue; if (!forInspection) diff --git a/src/openrct2/scripting/ScEntity.hpp b/src/openrct2/scripting/ScEntity.hpp index f19bea3633..ab1f46ff69 100644 --- a/src/openrct2/scripting/ScEntity.hpp +++ b/src/openrct2/scripting/ScEntity.hpp @@ -1085,7 +1085,7 @@ namespace OpenRCT2::Scripting auto peep = GetStaff(); if (peep != nullptr) { - switch (peep->StaffType) + switch (peep->AssignedStaffType) { case STAFF_TYPE_HANDYMAN: return "handyman"; @@ -1106,24 +1106,24 @@ namespace OpenRCT2::Scripting auto peep = GetStaff(); if (peep != nullptr) { - if (value == "handyman" && peep->StaffType != STAFF_TYPE_HANDYMAN) + if (value == "handyman" && peep->AssignedStaffType != STAFF_TYPE_HANDYMAN) { - peep->StaffType = STAFF_TYPE_HANDYMAN; + peep->AssignedStaffType = STAFF_TYPE_HANDYMAN; peep->SpriteType = PeepSpriteType::PEEP_SPRITE_TYPE_HANDYMAN; } - else if (value == "mechanic" && peep->StaffType != STAFF_TYPE_MECHANIC) + else if (value == "mechanic" && peep->AssignedStaffType != STAFF_TYPE_MECHANIC) { - peep->StaffType = STAFF_TYPE_MECHANIC; + peep->AssignedStaffType = STAFF_TYPE_MECHANIC; peep->SpriteType = PeepSpriteType::PEEP_SPRITE_TYPE_MECHANIC; } - else if (value == "security" && peep->StaffType != STAFF_TYPE_SECURITY) + else if (value == "security" && peep->AssignedStaffType != STAFF_TYPE_SECURITY) { - peep->StaffType = STAFF_TYPE_SECURITY; + peep->AssignedStaffType = STAFF_TYPE_SECURITY; peep->SpriteType = PeepSpriteType::PEEP_SPRITE_TYPE_SECURITY; } - else if (value == "entertainer" && peep->StaffType != STAFF_TYPE_ENTERTAINER) + else if (value == "entertainer" && peep->AssignedStaffType != STAFF_TYPE_ENTERTAINER) { - peep->StaffType = STAFF_TYPE_ENTERTAINER; + peep->AssignedStaffType = STAFF_TYPE_ENTERTAINER; peep->SpriteType = PeepSpriteType::PEEP_SPRITE_TYPE_ENTERTAINER_PANDA; } } @@ -1149,7 +1149,7 @@ namespace OpenRCT2::Scripting uint8_t costume_get() const { auto peep = GetStaff(); - if (peep != nullptr && peep->StaffType == STAFF_TYPE_ENTERTAINER) + if (peep != nullptr && peep->AssignedStaffType == STAFF_TYPE_ENTERTAINER) { return peep->GetCostume(); }