chore: client/server guards

This commit is contained in:
cha0s 2019-04-23 15:28:03 -05:00
parent 0e5a03336c
commit 49813a5edc

View File

@ -211,10 +211,13 @@ export class Vulnerable extends Trait {
} }
tick(elapsed) { tick(elapsed) {
if (AVOCADO_CLIENT) {
for (let i = 0; i < this.tookDamageActions.length; ++i) { for (let i = 0; i < this.tookDamageActions.length; ++i) {
const {context, actions} = this.tookDamageActions[i]; const {context, actions} = this.tookDamageActions[i];
actions.tick(context, elapsed); actions.tick(context, elapsed);
} }
}
if (AVOCADO_SERVER) {
if (Object.keys(this.damageList).length > 0) { if (Object.keys(this.damageList).length > 0) {
this.state = this.state.set('damageList', I.Map(this.damageList)); this.state = this.state.set('damageList', I.Map(this.damageList));
this.isDirty = true; this.isDirty = true;
@ -232,6 +235,7 @@ export class Vulnerable extends Trait {
} }
} }
} }
}
} }