diff --git a/src/customLobby.js b/src/customLobby.js index e54198c..6c572d6 100644 --- a/src/customLobby.js +++ b/src/customLobby.js @@ -193,7 +193,7 @@ function isCustomMessage(raw) { if (playerIsHost) optionsContainer.classList.remove("disabled"); else optionsContainer.classList.add("disabled"); Object.entries(data.options).forEach(([option, value]) => updateOption(option, value)); - displayPlayers(data.players); + displayPlayers(data.players, data.id); } else if (type === "addPlayer") { addPlayer({ name: data.name, inGame: false, isHost: false }); updatePlayerCount(); @@ -204,6 +204,7 @@ function isCustomMessage(raw) { updatePlayerCount(); } else if (type === "inLobby") { const index = data; + playerList[index].inGame = false; playerList[index].inGameBadge.className = "d-none"; } else if (type === "options") { const [option, value] = data; @@ -260,11 +261,11 @@ function kickButtonHandler(event) { } } /** @param {PlayerInfo[]} players */ -function displayPlayers(players) { +function displayPlayers(players, thisPlayerId) { playerList = []; playerListDiv.innerHTML = ""; players.forEach(addPlayer); - thisPlayer = playerList[playerList.length - 1]; + thisPlayer = playerList[thisPlayerId]; updatePlayerCount(); } function updatePlayerCount() { diff --git a/src/main.js b/src/main.js index 67bcd88..7195df2 100644 --- a/src/main.js +++ b/src/main.js @@ -1,5 +1,5 @@ -const fx_version = '0.6.7'; // FX Client Version -const fx_update = 'Feb 8'; // FX Client Last Updated +const fx_version = '0.6.7.1'; // FX Client Version +const fx_update = 'Feb 15'; // FX Client Last Updated if ("serviceWorker" in navigator) { navigator.serviceWorker.addEventListener("message", (e) => {