Fix custom lobby player IDs not being set correctly when rejoining a lobby
parent
2688e86b9d
commit
92980649eb
|
@ -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() {
|
||||
|
|
|
@ -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) => {
|
||||
|
|
Loading…
Reference in New Issue