1
0
mirror of https://github.com/OpenRCT2/OpenRCT2 synced 2026-01-04 13:42:55 +01:00

Rename Peep:staff_id to StaffId

This commit is contained in:
Tulio Leao
2020-05-31 18:21:57 -03:00
committed by Gymnasiast
parent d05e5f8dc7
commit 6dc08afdd0
8 changed files with 18 additions and 18 deletions

View File

@@ -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();

View File

@@ -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);
}

View File

@@ -246,7 +246,7 @@ private:
newPeep->energy_target = 0x60;
newPeep->StaffMowingTimeout = 0;
newPeep->staff_id = staffIndex;
newPeep->StaffId = staffIndex;
gStaffModes[staffIndex] = STAFF_MODE_WALK;

View File

@@ -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)

View File

@@ -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;

View File

@@ -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

View File

@@ -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)

View File

@@ -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);
}
}
}