diff --git a/src/engine/world/world.ts b/src/engine/world/world.ts index 9beb90c3f..89b57e348 100644 --- a/src/engine/world/world.ts +++ b/src/engine/world/world.ts @@ -519,7 +519,7 @@ export class World { public playerOnline(player: Player | string): boolean { if(typeof player === 'string') { player = player.toLowerCase(); - return this.playerList.findIndex(p => p !== null && p.username.toLowerCase() === player) !== -1; + return this.playerList.findIndex(p => Boolean(p) && p.username.toLowerCase() === player) !== -1; } else { const foundPlayer = this.playerList[player.worldIndex]; if(!foundPlayer) {