Commit 8a299ff9 authored by JoyJ's avatar JoyJ

make sure judge exists; min players set to 3

parent 08943051
Pipeline #17302 canceled with stages
...@@ -141,7 +141,7 @@ function roundEnded(game) { ...@@ -141,7 +141,7 @@ function roundEnded(game) {
player.selectedWhiteCardId = null; player.selectedWhiteCardId = null;
}); });
game.Judge++; game.Judge++;
if (game.Judge >= player.length) { if (game.Judge >= player.length || game.Judge == null || game.Judge == NaN) {
game.Judge = 0; game.Judge = 0;
} }
game.players[game.Judge] = false; game.players[game.Judge] = false;
......
...@@ -109,10 +109,10 @@ ...@@ -109,10 +109,10 @@
if (name.replace(/\s/g, "").length == 0) { if (name.replace(/\s/g, "").length == 0) {
name = "路过的假面骑士"; name = "路过的假面骑士";
} }
var num = prompt("建一个几人房?(必须在4以上,20以下)", "4"); var num = prompt("建一个几人房?(必须在3以上,20以下)", "4");
num = Number(num); num = Number(num);
if (num == NaN || num < 4) { if (num == NaN || num < 3) {
num = 4; num = 3;
} }
if (num > 20){ if (num > 20){
num = 20; num = 20;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment