chore: tidy

This commit is contained in:
cha0s 2019-11-03 22:13:49 -06:00
parent 43cfabfb7b
commit 754fde14b5

View File

@ -55,6 +55,12 @@ export class Tool extends decorate(Trait) {
this.toolSetup = behaviorItemFromJSON(this.params.setup); this.toolSetup = behaviorItemFromJSON(this.params.setup);
} }
destroy() {
if (AVOCADO_CLIENT) {
this.guidePrimitives.destroy();
}
}
calculateTargetStart() { calculateTargetStart() {
const wielder = this.entity.wielder; const wielder = this.entity.wielder;
if (!wielder) { if (!wielder) {
@ -196,22 +202,22 @@ export class Tool extends decorate(Trait) {
wielderChanged: (oldWielder, newWielder) => { wielderChanged: (oldWielder, newWielder) => {
if (oldWielder && oldWielder.is('visible')) { if (oldWielder && oldWielder.is('visible')) {
oldWielder.off( oldWielder.off(
'positionChanged', 'activeSlotIndexChanged',
this.onWielderPositionChanged, this.onWielderActiveSlotIndexChanged,
); );
oldWielder.off( oldWielder.off(
'directionChanged', 'directionChanged',
this.onWielderDirectionChanged, this.onWielderDirectionChanged,
); );
oldWielder.off( oldWielder.off(
'activeSlotIndexChanged', 'positionChanged',
this.onWielderActiveSlotIndexChanged, this.onWielderPositionChanged,
); );
} }
if (newWielder && newWielder.is('visible')) { if (newWielder && newWielder.is('visible')) {
newWielder.on( newWielder.on(
'positionChanged', 'activeSlotIndexChanged',
this.onWielderPositionChanged, this.onWielderActiveSlotIndexChanged,
this, this,
); );
newWielder.on( newWielder.on(
@ -220,8 +226,8 @@ export class Tool extends decorate(Trait) {
this, this,
); );
newWielder.on( newWielder.on(
'activeSlotIndexChanged', 'positionChanged',
this.onWielderActiveSlotIndexChanged, this.onWielderPositionChanged,
this, this,
); );
} }