Skip to content

Commit

Permalink
fix: Particle instance leak if ParticleEmitter killed during emission
Browse files Browse the repository at this point in the history
  • Loading branch information
eonarheim committed Nov 23, 2024
1 parent ca3d277 commit 70d979b
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/engine/Particles/Particles.ts
Original file line number Diff line number Diff line change
Expand Up @@ -124,9 +124,11 @@ export class Particle extends Entity {
}
}

public kill() {
if (this._emitter) {
public override kill() {
if (this._emitter?.active) {
this._emitter.removeParticle(this);
} else {
super.kill();
}
}

Expand Down

0 comments on commit 70d979b

Please sign in to comment.