chore: client/server guards
This commit is contained in:
parent
0e5a03336c
commit
49813a5edc
|
@ -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 {
|
|||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user