fix: prevent race in forceDeath

This commit is contained in:
cha0s 2019-05-03 02:23:43 -05:00
parent 114832c795
commit fbbe8b00d1

View File

@ -104,6 +104,9 @@ export class Alive extends decorate(Trait) {
},
forceDeath: () => {
if (this._isDying) {
return;
}
this._isDying = true;
this.entity.emit('dying');
this._deathActions.once('actionsFinished', () => {