Skip to content
Snippets Groups Projects
Commit 410cde2f authored by deuce's avatar deuce
Browse files

Fix undefined array element acces when removing the last element.

parent 373736b3
No related branches found
No related tags found
No related merge requests found
......@@ -230,8 +230,8 @@ var privtable = {
/* pack army list */
for(k = 0; k < armies.length; k++) {
while(armies[k].nation == -1)
armies.splice(k, 1);
while(armies[k].nation !== undefined && armies[k].nation == -1)
armies.splice(k, 1);
}
/* create new armies */
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment