1
0
mirror of https://github.com/OpenRCT2/OpenRCT2 synced 2026-01-15 11:03:00 +01:00

Make litter_remove_at use CoordsXYZ

This commit is contained in:
Tulio Leao
2020-06-21 14:06:56 -03:00
parent e24de95b82
commit 7622ca513e
3 changed files with 6 additions and 6 deletions

View File

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

View File

@@ -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<Litter>({ x, y }))
for (auto litter : EntityTileList<Litter>(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);

View File

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