mirror of https://github.com/OpenRCT2/OpenRCT2.git
Rework remove floating to use EntityList (#13895)
This commit is contained in:
parent
bc20efb3df
commit
1a11456f36
|
@ -827,29 +827,24 @@ void litter_remove_at(const CoordsXYZ& litterPos)
|
|||
uint16_t remove_floating_sprites()
|
||||
{
|
||||
uint16_t removed = 0;
|
||||
for (uint16_t i = 0; i < MAX_SPRITES; i++)
|
||||
for (auto* balloon : EntityList<Balloon>(EntityListId::Misc))
|
||||
{
|
||||
auto* entity = GetEntity(i);
|
||||
if (entity->Is<Balloon>())
|
||||
sprite_remove(balloon);
|
||||
removed++;
|
||||
}
|
||||
for (auto* duck : EntityList<Duck>(EntityListId::Misc))
|
||||
{
|
||||
if (duck->IsFlying())
|
||||
{
|
||||
sprite_remove(entity);
|
||||
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);
|
||||
sprite_remove(duck);
|
||||
removed++;
|
||||
}
|
||||
}
|
||||
for (auto* money : EntityList<MoneyEffect>(EntityListId::Misc))
|
||||
{
|
||||
sprite_remove(money);
|
||||
removed++;
|
||||
}
|
||||
return removed;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue