clear activatableObjectsDistances map before setting up fresh values

This commit is contained in:
Piotr 'pwh' Hanusiak 2022-04-27 16:25:12 +02:00 committed by David Négrier
parent 69bf8a814b
commit 9427ca8d7c

View File

@ -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);