Skip to content

Commit

Permalink
Merge branch 'master' of https://github.com/ottomated/CrewLink
Browse files Browse the repository at this point in the history
  • Loading branch information
ottomated committed Dec 30, 2020
2 parents 23a6e02 + b712295 commit b9d0509
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 5 deletions.
3 changes: 2 additions & 1 deletion src/main/GameReader.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 === '' ||
Expand Down
1 change: 1 addition & 0 deletions src/renderer/Avatar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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) =>
Expand Down
5 changes: 2 additions & 3 deletions src/renderer/Voice.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -390,7 +390,6 @@ const Voice: React.FC<VoiceProps> = function ({
clientId: number
) => {
console.log('Connect called', lobbyCode, playerId, clientId);
socket.emit('leave');
if (lobbyCode === 'MENU') {
Object.keys(peerConnections).forEach((k) => {
disconnectPeer(k);
Expand Down Expand Up @@ -476,7 +475,7 @@ const Voice: React.FC<VoiceProps> = 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) => {
Expand Down Expand Up @@ -655,7 +654,7 @@ const Voice: React.FC<VoiceProps> = function ({
} = {};

for (const k of Object.keys(socketClients)) {
if (socketClients[k].playerId)
if (socketClients[k].playerId !== undefined)
playerSocketIds[socketClients[k].playerId] = k;
}
return (
Expand Down
2 changes: 1 addition & 1 deletion src/renderer/settings/Settings.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -472,7 +472,7 @@ const Settings: React.FC<SettingsProps> = 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],
Expand Down

0 comments on commit b9d0509

Please sign in to comment.