make sure the user we try to get inside the group is not silent

This commit is contained in:
Piotr 'pwh' Hanusiak 2022-05-10 16:50:08 +02:00 committed by David Négrier
parent a6d6746c31
commit 7316637834

View File

@ -128,7 +128,7 @@ export class Group implements Movable {
for (const user of this.positionNotifier.getAllUsersInSquareAroundZone(this.currentZone)) {
// Todo: Merge two groups with a leader
if (user.group || this.isFull()) return; //we ignore users that are already in a group.
if (user.silent || user.group || this.isFull()) return; //we ignore users that are already in a group.
const distance = GameRoom.computeDistanceBetweenPositions(user.getPosition(), this.getPosition());
if (distance < this.groupRadius) {
this.join(user);