chore: tidy
This commit is contained in:
parent
43cfabfb7b
commit
754fde14b5
|
@ -55,6 +55,12 @@ export class Tool extends decorate(Trait) {
|
|||
this.toolSetup = behaviorItemFromJSON(this.params.setup);
|
||||
}
|
||||
|
||||
destroy() {
|
||||
if (AVOCADO_CLIENT) {
|
||||
this.guidePrimitives.destroy();
|
||||
}
|
||||
}
|
||||
|
||||
calculateTargetStart() {
|
||||
const wielder = this.entity.wielder;
|
||||
if (!wielder) {
|
||||
|
@ -196,22 +202,22 @@ export class Tool extends decorate(Trait) {
|
|||
wielderChanged: (oldWielder, newWielder) => {
|
||||
if (oldWielder && oldWielder.is('visible')) {
|
||||
oldWielder.off(
|
||||
'positionChanged',
|
||||
this.onWielderPositionChanged,
|
||||
'activeSlotIndexChanged',
|
||||
this.onWielderActiveSlotIndexChanged,
|
||||
);
|
||||
oldWielder.off(
|
||||
'directionChanged',
|
||||
this.onWielderDirectionChanged,
|
||||
);
|
||||
oldWielder.off(
|
||||
'activeSlotIndexChanged',
|
||||
this.onWielderActiveSlotIndexChanged,
|
||||
'positionChanged',
|
||||
this.onWielderPositionChanged,
|
||||
);
|
||||
}
|
||||
if (newWielder && newWielder.is('visible')) {
|
||||
newWielder.on(
|
||||
'positionChanged',
|
||||
this.onWielderPositionChanged,
|
||||
'activeSlotIndexChanged',
|
||||
this.onWielderActiveSlotIndexChanged,
|
||||
this,
|
||||
);
|
||||
newWielder.on(
|
||||
|
@ -220,8 +226,8 @@ export class Tool extends decorate(Trait) {
|
|||
this,
|
||||
);
|
||||
newWielder.on(
|
||||
'activeSlotIndexChanged',
|
||||
this.onWielderActiveSlotIndexChanged,
|
||||
'positionChanged',
|
||||
this.onWielderPositionChanged,
|
||||
this,
|
||||
);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user