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