diff --git a/index.js b/index.js index 0015e86..c839fa1 100644 --- a/index.js +++ b/index.js @@ -62,8 +62,8 @@ app.ws('/', function (ws, req) { } ); j = await j.json(); - if (game.ws.findIndex(x => x.username == j.username) != -1) { - console.log(`Player ${player.you} uses username ${ws.username} illegally`) + if (game.ws.findIndex(x => x.username == j.username && x.health >= 0) != -1) { + console.log(`Player ${player.you} uses username ${x.username} illegally`) return; } ws.username = j.username;