Fix dropping and joining
This commit is contained in:
@@ -355,15 +355,24 @@ function join() {
|
|||||||
var redundant = false;
|
var redundant = false;
|
||||||
var set = false;
|
var set = false;
|
||||||
for (var i = 0; i < game.Players.length; i++) {
|
for (var i = 0; i < game.Players.length; i++) {
|
||||||
if (!set && game.Players[i].ID == "") {
|
if (!set && game.Players[i].ID == id) {
|
||||||
game.Players[i] = {
|
game.Players[i].Name = name
|
||||||
ID: id,
|
game.Players[i].Participating = true
|
||||||
Name: name,
|
set = true
|
||||||
Participating: 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) {
|
if (!set) {
|
||||||
|
|||||||
Reference in New Issue
Block a user