Skip to content

Commit

Permalink
tweak rules
Browse files Browse the repository at this point in the history
  • Loading branch information
Half-Shot committed Jan 9, 2025
1 parent 1115e98 commit cf5a13d
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 9 deletions.
15 changes: 7 additions & 8 deletions src/frontend/components/menus/lobby.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -119,15 +119,14 @@ export function ActiveLobby({
[gameInstance],
);

const viableToStart = true;

// const viableToStart = useMemo(() =>
// gameInstance.isHost && members.length >= 2 && proposedTeams.length >= 2 &&
// proposedTeams.reduce<Partial<Record<TeamGroup, number>>>((v, o) => ({
// ...v,
// [o.group]: (v[o.group] ?? 0) + 1
// }), { })
// , [gameInstance, members, proposedTeams]);
const viableToStart = useMemo(() =>
gameInstance.isHost && members.length >= 2 && proposedTeams.length >= 2 &&
proposedTeams.reduce<Partial<Record<TeamGroup, number>>>((v, o) => ({
...v,
[o.group]: (v[o.group] ?? 0) + 1
}), { })
, [gameInstance, members, proposedTeams]);

const lobbyLink = `${window.location.origin}${window.location.pathname}?gameRoomId=${encodeURIComponent(gameInstance.roomId)}`;
return (
Expand Down
2 changes: 1 addition & 1 deletion src/frontend/components/menus/online-play.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ function LoggedInView({
client
.createGameRoom({
rules: {
winWhenOneGroupRemains: false,
winWhenOneGroupRemains: true,
wormHealth: 100,
ammoSchema: DefaultWeaponSchema,
},
Expand Down

0 comments on commit cf5a13d

Please sign in to comment.