diff --git a/src/openrct2/peep/Staff.cpp b/src/openrct2/peep/Staff.cpp index 704c49cc4c..0be73aa635 100644 --- a/src/openrct2/peep/Staff.cpp +++ b/src/openrct2/peep/Staff.cpp @@ -1386,7 +1386,7 @@ void Staff::UpdateSweeping() if (Action == PEEP_ACTION_STAFF_SWEEP && ActionFrame == 8) { // Remove sick at this location - litter_remove_at(x, y, z); + litter_remove_at({ x, y, z }); StaffLitterSwept++; WindowInvalidateFlags |= PEEP_INVALIDATE_STAFF_STATS; } diff --git a/src/openrct2/world/Sprite.cpp b/src/openrct2/world/Sprite.cpp index 15d1d73068..df04024f5d 100644 --- a/src/openrct2/world/Sprite.cpp +++ b/src/openrct2/world/Sprite.cpp @@ -836,13 +836,13 @@ void litter_create(int32_t x, int32_t y, int32_t z, int32_t direction, int32_t t * * rct2: 0x006738E1 */ -void litter_remove_at(int32_t x, int32_t y, int32_t z) +void litter_remove_at(const CoordsXYZ& litterPos) { - for (auto litter : EntityTileList({ x, y })) + for (auto litter : EntityTileList(litterPos)) { - if (abs(litter->z - z) <= 16) + if (abs(litter->z - litterPos.z) <= 16) { - if (abs(litter->x - x) <= 8 && abs(litter->y - y) <= 8) + if (abs(litter->x - litterPos.x) <= 8 && abs(litter->y - litterPos.y) <= 8) { litter->Invalidate0(); sprite_remove(litter); diff --git a/src/openrct2/world/Sprite.h b/src/openrct2/world/Sprite.h index 4688d85015..2943b040e1 100644 --- a/src/openrct2/world/Sprite.h +++ b/src/openrct2/world/Sprite.h @@ -220,7 +220,7 @@ void sprite_misc_update_all(); void sprite_set_coordinates(const CoordsXYZ& spritePos, SpriteBase* sprite); void sprite_remove(SpriteBase* sprite); void litter_create(int32_t x, int32_t y, int32_t z, int32_t direction, int32_t type); -void litter_remove_at(int32_t x, int32_t y, int32_t z); +void litter_remove_at(const CoordsXYZ& litterPos); uint16_t remove_floating_sprites(); void sprite_misc_explosion_cloud_create(const CoordsXYZ& cloudPos); void sprite_misc_explosion_flare_create(const CoordsXYZ& flarePos);