FiguraMC / Figura

Extensively customize your character with Figura!
https://modrinth.com/mod/figura
GNU Lesser General Public License v2.1
247 stars 45 forks source link

Fix particles not being removed #161

Closed 4P5 closed 9 months ago

4P5 commented 10 months ago

This should fix an issue that's been around for a while where particles weren't removed on avatar reload, script errors, and particles:removeParticles()

The bug was caused by the mixin for tickParticleList targeting tickParticle. This immediately and unconditionally removes the particle from particleMap, despite the particle still being active. When figura$clearParticles is called, particleMap is empty and nothing happens.

My fix is to change the mixin to target the iterator.remove(); call (when the particle is no longer alive), meaning the particle is only removed from particleMap when it's actually removed.