chore: free's

This commit is contained in:
cha0s 2019-04-30 18:23:53 -05:00
parent 50f1606a2b
commit e4ef3799f1
3 changed files with 12 additions and 0 deletions

View File

@ -66,6 +66,10 @@ export class Alive extends decorate(Trait) {
this._isDying = false;
}
destroy() {
this._context.clear();
}
get deathSound() {
return this._deathSound;
}

View File

@ -46,6 +46,11 @@ export class Vulnerable extends Trait {
this.tookDamageActionsList = [];
}
destroy() {
this.locks.clear();
this.tookDamageActionsList = [];
}
hydrate() {
this._isHydrating = true;
this.addEmitter();
@ -62,6 +67,7 @@ export class Vulnerable extends Trait {
const tuple = {context, actions};
this.tookDamageActionsList.push(tuple);
actions.on('actionsFinished', () => {
context.clear();
const index = this.tookDamageActionsList.indexOf(tuple);
this.tookDamageActionsList.splice(tuple);
});

View File

@ -28,6 +28,8 @@ export class Informed extends decorate(Trait) {
delete this._socket.entity;
delete this._socket;
}
this._rememberedEntities = {};
this._state = this._state.clear();
}
get areaToInform() {