This commit is contained in:
Pavel Flegr 2026-05-07 19:46:01 +02:00
commit 7b54ed8e53
3 changed files with 21 additions and 0 deletions

View file

@ -585,6 +585,10 @@ func (g *Game) buildState(p *Player, chosenSuit Suit) GameScriptState {
copy(h, pl.Hand)
hands[i] = h
}
discardCopy := make([]Card, len(g.DiscardPile))
copy(discardCopy, g.DiscardPile)
deckCopy := make([]Card, len(g.Deck))
copy(deckCopy, g.Deck)
return GameScriptState{
ActiveSuit: g.ActiveSuit,
@ -593,6 +597,8 @@ func (g *Game) buildState(p *Player, chosenSuit Suit) GameScriptState {
ChosenSuit: chosenSuit,
Hand: handCopy,
PlayerHands: hands,
DiscardPile: discardCopy,
Deck: deckCopy,
CurrentPlayerIndex: g.CurrentPlayer,
PlayerCount: len(g.Players),
HandCounts: counts,