fix: only listen to action finished once
This commit is contained in:
parent
6db0c2bcdd
commit
73b6ee4d04
|
@ -106,7 +106,7 @@ export class Alive extends decorate(Trait) {
|
||||||
forceDeath: () => {
|
forceDeath: () => {
|
||||||
this._isDying = true;
|
this._isDying = true;
|
||||||
this.entity.emit('dying');
|
this.entity.emit('dying');
|
||||||
this._deathActions.on('actionsFinished', () => {
|
this._deathActions.once('actionsFinished', () => {
|
||||||
if (this.entity.is('existent')) {
|
if (this.entity.is('existent')) {
|
||||||
this.entity.destroy();
|
this.entity.destroy();
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user