AddPlayer für leere Liste gefixt
This commit is contained in:
parent
ea153db8a9
commit
e43dd0a6ef
1 changed files with 7 additions and 0 deletions
|
@ -173,6 +173,9 @@ function CurrentPlayer(){
|
|||
|
||||
function AddPlayer(player){
|
||||
var hinzugefügt = false;
|
||||
if (player.length == 0){
|
||||
players.push(player);
|
||||
}
|
||||
if (player.Tick == "Abwarten"){
|
||||
players.push(player);
|
||||
}
|
||||
|
@ -181,8 +184,12 @@ function AddPlayer(player){
|
|||
for (i = players.length; i>0;i++){
|
||||
if (players[i-1].Tick != "Abwarten"){
|
||||
players.splice(i,0,player);
|
||||
hinzugefügt = true;
|
||||
break;
|
||||
}
|
||||
if (i == 1 && hinzugefügt == false){
|
||||
players.splice(0,0,player);
|
||||
}
|
||||
}
|
||||
}
|
||||
else {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue