From 6c512fb7cd9d4b0f9391489b9e0919cba38ea88a Mon Sep 17 00:00:00 2001 From: Johannes Berthel Date: Sat, 3 Apr 2021 00:18:08 +0200 Subject: [PATCH] fixed linting --- front/src/Phaser/Companion/Companion.ts | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/front/src/Phaser/Companion/Companion.ts b/front/src/Phaser/Companion/Companion.ts index cb932cbb..e578dd3d 100644 --- a/front/src/Phaser/Companion/Companion.ts +++ b/front/src/Phaser/Companion/Companion.ts @@ -16,6 +16,7 @@ export class Companion extends Container { private delta: number; private invisible: boolean; + private updateListener: Function; private target: { x: number, y: number, direction: PlayerAnimationDirections }; private companionName: string; @@ -53,7 +54,8 @@ export class Companion extends Container { this.setDepth(-1); - this.scene.events.addListener('update', this.step, this); + this.updateListener = this.step.bind(this); + this.scene.events.addListener('update', this.updateListener); this.scene.add.existing(this); } @@ -213,7 +215,7 @@ export class Companion extends Container { } if (this.scene) { - this.scene.events.removeListener('update', this.step, this); + this.scene.events.removeListener('update', this.updateListener); } super.destroy();