Skip to content

Commit b9d0509

Browse files
committed
Merge branch 'master' of https://github.com/ottomated/CrewLink
2 parents 23a6e02 + b712295 commit b9d0509

File tree

4 files changed

+6
-5
lines changed

4 files changed

+6
-5
lines changed

src/main/GameReader.ts

+2-1
Original file line numberDiff line numberDiff line change
@@ -202,7 +202,8 @@ export default class GameReader {
202202
this.PlayerStruct
203203
);
204204
playerAddrPtr += 4;
205-
players.push(player);
205+
if (state !== GameState.MENU)
206+
players.push(player);
206207

207208
if (
208209
player.name === '' ||

src/renderer/Avatar.tsx

+1
Original file line numberDiff line numberDiff line change
@@ -141,6 +141,7 @@ const useCanvasStyles = makeStyles(() => ({
141141
position: 'absolute',
142142
top: '38%',
143143
left: '17%',
144+
width: '73.5%',
144145
transform: 'scale(0.8)',
145146
zIndex: 3,
146147
display: ({ isAlive }: UseCanvasStylesParams) =>

src/renderer/Voice.tsx

+2-3
Original file line numberDiff line numberDiff line change
@@ -390,7 +390,6 @@ const Voice: React.FC<VoiceProps> = function ({
390390
clientId: number
391391
) => {
392392
console.log('Connect called', lobbyCode, playerId, clientId);
393-
socket.emit('leave');
394393
if (lobbyCode === 'MENU') {
395394
Object.keys(peerConnections).forEach((k) => {
396395
disconnectPeer(k);
@@ -476,7 +475,7 @@ const Voice: React.FC<VoiceProps> = function ({
476475
});
477476
});
478477
connection.on('data', (data) => {
479-
if (gameState.hostId !== socketClientsRef.current[peer].clientId)
478+
if (gameState.hostId !== socketClientsRef.current[peer]?.clientId)
480479
return;
481480
const settings = JSON.parse(data);
482481
Object.keys(lobbySettings).forEach((field: string) => {
@@ -655,7 +654,7 @@ const Voice: React.FC<VoiceProps> = function ({
655654
} = {};
656655

657656
for (const k of Object.keys(socketClients)) {
658-
if (socketClients[k].playerId)
657+
if (socketClients[k].playerId !== undefined)
659658
playerSocketIds[socketClients[k].playerId] = k;
660659
}
661660
return (

src/renderer/settings/Settings.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -472,7 +472,7 @@ const Settings: React.FC<SettingsProps> = function ({
472472
if (k === 'Control' || k === 'Alt' || k === 'Shift')
473473
k = (ev.location === 1 ? 'L' : 'R') + k;
474474

475-
if (/^[0-9A-Z]$/.test(k) || /^F[0-9]{1, 2}$/.test(k) || keys.has(k)) {
475+
if (/^[0-9A-Z]$/.test(k) || /^F[0-9]{1,2}$/.test(k) || keys.has(k)) {
476476
setSettings({
477477
type: 'setOne',
478478
action: [shortcut, k],

0 commit comments

Comments
 (0)