Skip to content

Commit

Permalink
Merge pull request #126 from RuneLabsxyz/double-controller
Browse files Browse the repository at this point in the history
Double controller
  • Loading branch information
0xMugen authored Oct 10, 2024
2 parents 8b6d096 + 26cf1d2 commit c0ed15f
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion client/src/lib/game.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ export async function joinSession(session: any) {
if (get(account)) {
console.log('Joining session', session.value)
await client.start.join({ account: get(account), session_id: session.value })
window.location.href = `/game/${session.value}`
window.location.href = `/${get(env)}/game/${session.value}`
} else {
console.error('No active account found')
}
Expand Down
4 changes: 2 additions & 2 deletions client/src/lib/ui/StartGame.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,11 @@
}
}
// On mount, if the game state is equals to 1 and you are the new player that just joined (player 2), spawn the characters.
$: if ($gameState === 1 && $currentPlayerId === 2) {
$: if ($gameState === 1 && $currentPlayerId === 2 && $account) {
console.log('Spawning characters')
spawn()
}
</script>

{#if $gameState == 1}
Expand Down

0 comments on commit c0ed15f

Please sign in to comment.