From 9a7140b027cea15cb84d17ab9fb1876306671c2d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?David=20N=C3=A9grier?= Date: Fri, 28 Jan 2022 11:10:47 +0100 Subject: [PATCH] Fixing users walking infinitely Now, if no event is received from the Pusher after MAX_EXTRAPOLATION_TIME, the moving variable of the user is set to false. So if a client does not send an update on time (for instance if the user switched tab while walking), on the screen of others, the woka will appear to stop. --- front/src/Phaser/Game/PlayerMovement.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/front/src/Phaser/Game/PlayerMovement.ts b/front/src/Phaser/Game/PlayerMovement.ts index 274cbee1..fc14078d 100644 --- a/front/src/Phaser/Game/PlayerMovement.ts +++ b/front/src/Phaser/Game/PlayerMovement.ts @@ -41,7 +41,7 @@ export class PlayerMovement { oldX: this.startPosition.x, oldY: this.startPosition.y, direction: this.endPosition.direction, - moving: this.endPosition.moving, + moving: this.isOutdated(tick) ? false : this.endPosition.moving, }; } }