Clean up follow implementation; stop following when leader leaves the scene

This commit is contained in:
PizZaKatZe 2021-12-14 18:47:51 +01:00
parent 7bff782f7f
commit 290e5131e9
3 changed files with 40 additions and 79 deletions

View file

@ -1715,6 +1715,10 @@ ${escapedMessage}
});
}
public findPlayer(testFunction: (player: RemotePlayer) => boolean): RemotePlayer | undefined {
return Array.from(this.MapPlayersByKey.values()).find(testFunction);
}
/**
* Called by the connexion when a new player arrives on a map
*/