diff --git a/src/main/GameReader.ts b/src/main/GameReader.ts index a6ffc1d8..9a361880 100644 --- a/src/main/GameReader.ts +++ b/src/main/GameReader.ts @@ -202,7 +202,8 @@ export default class GameReader { this.PlayerStruct ); playerAddrPtr += 4; - players.push(player); + if (state !== GameState.MENU) + players.push(player); if ( player.name === '' || diff --git a/src/renderer/Avatar.tsx b/src/renderer/Avatar.tsx index 07aff0c4..ca55e6f5 100644 --- a/src/renderer/Avatar.tsx +++ b/src/renderer/Avatar.tsx @@ -141,6 +141,7 @@ const useCanvasStyles = makeStyles(() => ({ position: 'absolute', top: '38%', left: '17%', + width: '73.5%', transform: 'scale(0.8)', zIndex: 3, display: ({ isAlive }: UseCanvasStylesParams) => diff --git a/src/renderer/Voice.tsx b/src/renderer/Voice.tsx index 1f9f6043..d830c868 100644 --- a/src/renderer/Voice.tsx +++ b/src/renderer/Voice.tsx @@ -390,7 +390,6 @@ const Voice: React.FC = function ({ clientId: number ) => { console.log('Connect called', lobbyCode, playerId, clientId); - socket.emit('leave'); if (lobbyCode === 'MENU') { Object.keys(peerConnections).forEach((k) => { disconnectPeer(k); @@ -476,7 +475,7 @@ const Voice: React.FC = function ({ }); }); connection.on('data', (data) => { - if (gameState.hostId !== socketClientsRef.current[peer].clientId) + if (gameState.hostId !== socketClientsRef.current[peer]?.clientId) return; const settings = JSON.parse(data); Object.keys(lobbySettings).forEach((field: string) => { @@ -655,7 +654,7 @@ const Voice: React.FC = function ({ } = {}; for (const k of Object.keys(socketClients)) { - if (socketClients[k].playerId) + if (socketClients[k].playerId !== undefined) playerSocketIds[socketClients[k].playerId] = k; } return ( diff --git a/src/renderer/settings/Settings.tsx b/src/renderer/settings/Settings.tsx index c338ab3d..482534d6 100644 --- a/src/renderer/settings/Settings.tsx +++ b/src/renderer/settings/Settings.tsx @@ -472,7 +472,7 @@ const Settings: React.FC = function ({ if (k === 'Control' || k === 'Alt' || k === 'Shift') k = (ev.location === 1 ? 'L' : 'R') + k; - if (/^[0-9A-Z]$/.test(k) || /^F[0-9]{1, 2}$/.test(k) || keys.has(k)) { + if (/^[0-9A-Z]$/.test(k) || /^F[0-9]{1,2}$/.test(k) || keys.has(k)) { setSettings({ type: 'setOne', action: [shortcut, k],