When a user moves, do not trigger group creation

In order to avoid triggering group creation when walking next to someone we should avoid creating a group unless the user stops next to the other members of the group.
This commit is contained in:
David Négrier 2020-10-22 16:15:30 +02:00
parent c8434dfd4c
commit b7854dfb90

View File

@ -138,6 +138,12 @@ export class GameRoom {
if (user.group === undefined) { if (user.group === undefined) {
// If the user is not part of a group: // If the user is not part of a group:
// should he join a group? // should he join a group?
// If the user is moving, don't try to join
if (user.getPosition().moving) {
return;
}
const closestItem: User|Group|null = this.searchClosestAvailableUserOrGroup(user); const closestItem: User|Group|null = this.searchClosestAvailableUserOrGroup(user);
if (closestItem !== null) { if (closestItem !== null) {