mirror of
https://github.com/OpenRCT2/OpenRCT2
synced 2025-12-23 15:52:55 +01:00
Rework remove floating to use EntityList (#13895)
This commit is contained in:
@@ -827,29 +827,24 @@ void litter_remove_at(const CoordsXYZ& litterPos)
|
|||||||
uint16_t remove_floating_sprites()
|
uint16_t remove_floating_sprites()
|
||||||
{
|
{
|
||||||
uint16_t removed = 0;
|
uint16_t removed = 0;
|
||||||
for (uint16_t i = 0; i < MAX_SPRITES; i++)
|
for (auto* balloon : EntityList<Balloon>(EntityListId::Misc))
|
||||||
{
|
{
|
||||||
auto* entity = GetEntity(i);
|
sprite_remove(balloon);
|
||||||
if (entity->Is<Balloon>())
|
removed++;
|
||||||
|
}
|
||||||
|
for (auto* duck : EntityList<Duck>(EntityListId::Misc))
|
||||||
|
{
|
||||||
|
if (duck->IsFlying())
|
||||||
{
|
{
|
||||||
sprite_remove(entity);
|
sprite_remove(duck);
|
||||||
removed++;
|
|
||||||
}
|
|
||||||
else if (entity->Is<Duck>())
|
|
||||||
{
|
|
||||||
auto* duck = entity->As<Duck>();
|
|
||||||
if (duck->IsFlying())
|
|
||||||
{
|
|
||||||
duck->Remove();
|
|
||||||
removed++;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else if (entity->Is<MoneyEffect>())
|
|
||||||
{
|
|
||||||
sprite_remove(entity);
|
|
||||||
removed++;
|
removed++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
for (auto* money : EntityList<MoneyEffect>(EntityListId::Misc))
|
||||||
|
{
|
||||||
|
sprite_remove(money);
|
||||||
|
removed++;
|
||||||
|
}
|
||||||
return removed;
|
return removed;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user