From 77167c28a6adbcb773a3638a0159663a40088222 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?David=20N=C3=A9grier?= Date: Thu, 11 Jun 2020 10:00:30 +0200 Subject: [PATCH] Making sure that even is a user did not move, the reconnection can happen without issues and resume at the old position --- front/src/Connection.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/front/src/Connection.ts b/front/src/Connection.ts index 3c1bc2d4..15e58707 100644 --- a/front/src/Connection.ts +++ b/front/src/Connection.ts @@ -232,6 +232,8 @@ export class Connection implements ConnectionInterface { } joinARoom(roomId: string, startX: number, startY: number, direction: string, moving: boolean): void { + let point = new Point(startX, startY, direction, moving); + this.lastPositionShared = point; this.getSocket().emit(EventMessage.JOIN_ROOM, { roomId, position: {x: startX, y: startY, direction, moving }}, (userPositions: MessageUserPositionInterface[]) => { this.GameManager.initUsersPosition(userPositions); });