Fix dropping and joining

This commit is contained in:
Bel LaPointe
2021-03-12 11:24:15 -06:00
parent 6ec195d2ac
commit 0511d661f7

View File

@@ -355,15 +355,24 @@ function join() {
var redundant = false;
var set = false;
for (var i = 0; i < game.Players.length; i++) {
if (!set && game.Players[i].ID == "") {
game.Players[i] = {
ID: id,
Name: name,
Participating: true,
if (!set && game.Players[i].ID == id) {
game.Players[i].Name = name
game.Players[i].Participating = true
set = true
}
}
if (!set) {
for (var i = 0; i < game.Players.length; i++) {
if (!set && game.Players[i].ID == "") {
game.Players[i] = {
ID: id,
Name: name,
Participating: true,
}
set = true;
} else {
redundant = redundant || game.Players[i].ID == id;
}
set = true;
} else {
redundant = redundant || game.Players[i].ID == id;
}
}
if (!set) {