summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKyle Gunger <kgunger12@gmail.com>2022-08-11 20:42:10 -0400
committerKyle Gunger <kgunger12@gmail.com>2022-08-11 20:42:10 -0400
commit022950ff4989d6394d193a23de8c91ee4e17fc4d (patch)
tree985c8d79f7de9ef5fc52b99c7232f48cd5db844b
parent6287b2a6afadce021700d6843012b9b9e7ac4954 (diff)
Fix game count
-rw-r--r--scripts/gui/lobby.js7
1 files changed, 6 insertions, 1 deletions
diff --git a/scripts/gui/lobby.js b/scripts/gui/lobby.js
index 64af615..a32c47f 100644
--- a/scripts/gui/lobby.js
+++ b/scripts/gui/lobby.js
@@ -142,6 +142,7 @@ class Lobby {
this.init = false;
this.online = [];
this.games = {};
+ this.gameCt = 0;
this.packs = [];
}
@@ -162,6 +163,7 @@ class Lobby {
for (let i of data.games) {
if(typeof i != "object")
continue;
+ this.gameCt++;
if (this.games[i.id] == null) {
let g = new Game(i, this.e.games);
@@ -173,7 +175,7 @@ class Lobby {
this.e.stats.game.innerText = data.game;
this.e.stats.packs.innerText = data.packs;
- this.e.stats.pubgame.innerText = this.games.length();
+ this.e.stats.pubgame.innerText = this.gameCt;
}
// Set the initial player list.
@@ -197,6 +199,8 @@ class Lobby {
if(this.games[data.id] == null) {
let g = new Game(data, this.e.games);
this.games[data.id] = g;
+ this.gameCt++;
+ this.e.stats.pubgame.innerText = this.gameCt;
}
}
@@ -239,5 +243,6 @@ class Lobby {
this.setState("Connecting", "loading", this.e.addr.innerText);
this.init = false;
+ this.gameCt = 0;
}
}