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.
This commit is contained in:
David Négrier 2022-01-28 11:10:47 +01:00
parent dd920c96db
commit 9a7140b027

View File

@ -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,
};
}
}