From 9427ca8d7c6fa2b231490b9ef2f7e38f922b2017 Mon Sep 17 00:00:00 2001 From: Piotr 'pwh' Hanusiak Date: Wed, 27 Apr 2022 16:25:12 +0200 Subject: [PATCH] clear activatableObjectsDistances map before setting up fresh values --- front/src/Phaser/Game/ActivatablesManager.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/front/src/Phaser/Game/ActivatablesManager.ts b/front/src/Phaser/Game/ActivatablesManager.ts index b41c5a72..7f337cda 100644 --- a/front/src/Phaser/Game/ActivatablesManager.ts +++ b/front/src/Phaser/Game/ActivatablesManager.ts @@ -76,6 +76,7 @@ export class ActivatablesManager { const currentPlayerPos = this.currentPlayer.getDirectionalActivationPosition( this.directionalActivationPositionShift ); + this.activatableObjectsDistances.clear(); for (const object of objects) { const distance = MathUtils.distanceBetween(currentPlayerPos, object.getPosition()); this.activatableObjectsDistances.set(object, distance);