mirror of
https://github.com/OpenRCT2/OpenRCT2
synced 2026-01-22 14:24:33 +01:00
Part of #12162: Use CoordsXY on staff_toggle_patrol_area
This commit is contained in:
@@ -76,7 +76,7 @@ public:
|
||||
|
||||
int32_t patrolOffset = peep->StaffId * STAFF_PATROL_AREA_SIZE;
|
||||
|
||||
staff_toggle_patrol_area(peep->StaffId, _loc.x, _loc.y);
|
||||
staff_toggle_patrol_area(peep->StaffId, _loc);
|
||||
|
||||
bool isPatrolling = false;
|
||||
for (int32_t i = 0; i < 128; i++)
|
||||
|
||||
@@ -419,14 +419,12 @@ void staff_set_patrol_area(int32_t staffIndex, int32_t x, int32_t y, bool value)
|
||||
}
|
||||
}
|
||||
|
||||
void staff_toggle_patrol_area(int32_t staffIndex, int32_t x, int32_t y)
|
||||
void staff_toggle_patrol_area(int32_t staffIndex, const CoordsXY& coords)
|
||||
{
|
||||
x = (x & 0x1F80) >> 7;
|
||||
y = (y & 0x1F80) >> 1;
|
||||
|
||||
auto offsetCoords = CoordsXY{ (coords.x & 0x1F80) >> 7, (coords.y & 0x1F80) >> 1 };
|
||||
int32_t peepOffset = staffIndex * STAFF_PATROL_AREA_SIZE;
|
||||
int32_t offset = (x | y) >> 5;
|
||||
int32_t bitIndex = (x | y) & 0x1F;
|
||||
int32_t offset = (offsetCoords.x | offsetCoords.y) >> 5;
|
||||
int32_t bitIndex = (offsetCoords.x | offsetCoords.y) & 0x1F;
|
||||
gStaffPatrolAreas[peepOffset + offset] ^= (1 << bitIndex);
|
||||
}
|
||||
|
||||
|
||||
@@ -82,7 +82,7 @@ bool staff_can_ignore_wide_flag(Peep* mechanic, const CoordsXYZ& staffPos, TileE
|
||||
void staff_reset_stats();
|
||||
bool staff_is_patrol_area_set_for_type(STAFF_TYPE type, const CoordsXY& coords);
|
||||
void staff_set_patrol_area(int32_t staffIndex, int32_t x, int32_t y, bool value);
|
||||
void staff_toggle_patrol_area(int32_t staffIndex, int32_t x, int32_t y);
|
||||
void staff_toggle_patrol_area(int32_t staffIndex, const CoordsXY& coords);
|
||||
colour_t staff_get_colour(uint8_t staffType);
|
||||
bool staff_set_colour(uint8_t staffType, colour_t value);
|
||||
uint32_t staff_get_available_entertainer_costumes();
|
||||
|
||||
Reference in New Issue
Block a user