refactor: don't early out client/server

This commit is contained in:
cha0s 2019-06-05 21:19:42 -05:00
parent 46f557626a
commit ae21ba05a6

View File

@ -113,9 +113,7 @@ export class Tool extends decorate(Trait) {
onWielderActiveSlotIndexChanged() { onWielderActiveSlotIndexChanged() {
this.calculateTargets(); this.calculateTargets();
if (AVOCADO_SERVER) { if (AVOCADO_CLIENT) {
return;
}
const wielder = this.entity.wielder; const wielder = this.entity.wielder;
if (!wielder) { if (!wielder) {
return; return;
@ -130,6 +128,7 @@ export class Tool extends decorate(Trait) {
wielder.container.removeChild(this.guidePrimitives); wielder.container.removeChild(this.guidePrimitives);
} }
} }
}
onWielderDirectionChanged() { onWielderDirectionChanged() {
this.calculateTargets(); this.calculateTargets();
@ -142,9 +141,7 @@ export class Tool extends decorate(Trait) {
} }
renderPrimitives() { renderPrimitives() {
if (AVOCADO_SERVER) { if (AVOCADO_CLIENT) {
return;
}
this.guidePrimitives.clear(); this.guidePrimitives.clear();
const wielder = this.entity.wielder; const wielder = this.entity.wielder;
if (!wielder) { if (!wielder) {
@ -173,11 +170,10 @@ export class Tool extends decorate(Trait) {
); );
} }
} }
}
repositionPrimitives() { repositionPrimitives() {
if (AVOCADO_SERVER) { if (AVOCADO_CLIENT) {
return;
}
const wielder = this.entity.wielder; const wielder = this.entity.wielder;
if (!wielder) { if (!wielder) {
return; return;
@ -187,6 +183,7 @@ export class Tool extends decorate(Trait) {
} }
this.guidePrimitives.position = Vector.scale(wielder.tileOffset, -1); this.guidePrimitives.position = Vector.scale(wielder.tileOffset, -1);
} }
}
listeners() { listeners() {
return { return {