mirror of
https://github.com/HexCardGames/HexDeck.git
synced 2025-09-05 03:08:39 +02:00
fix: make sure player is active before drawing a card
This commit is contained in:
@ -218,7 +218,7 @@ func onPlayerJoin(client *socketio.Socket, room *types.Room, player *types.Playe
|
|||||||
// TODO: Handle empty card deck
|
// TODO: Handle empty card deck
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
game.OnPlayerStateUpdate(room, player, false)
|
game.UpdateAllPlayers(room)
|
||||||
})
|
})
|
||||||
|
|
||||||
client.On("PlayCard", func(datas ...any) {
|
client.On("PlayCard", func(datas ...any) {
|
||||||
|
@ -32,7 +32,12 @@
|
|||||||
</div>
|
</div>
|
||||||
<div class="center grid grid-cols-2">
|
<div class="center grid grid-cols-2">
|
||||||
<div class="drawCard flex justify-center items-center">
|
<div class="drawCard flex justify-center items-center">
|
||||||
<button class="draw" on:click={() => sessionStore.drawCard()}>
|
<button
|
||||||
|
class="draw"
|
||||||
|
on:click={() => {
|
||||||
|
if (get(playerActive)) sessionStore.drawCard();
|
||||||
|
}}
|
||||||
|
>
|
||||||
<svelte:component this={cardComponent} width={cardWidth} height={cardHeight} data={{ Color: "black", Symbol: "special:draw" }} />
|
<svelte:component this={cardComponent} width={cardWidth} height={cardHeight} data={{ Color: "black", Symbol: "special:draw" }} />
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
|
Reference in New Issue
Block a user