From 00bd3539b02860242349697fe713ea618a22eecb Mon Sep 17 00:00:00 2001 From: Steve Date: Sun, 25 Jul 2021 22:03:31 -0400 Subject: [PATCH] don't panic on drawing from empty scry --- internal/game/game.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/internal/game/game.go b/internal/game/game.go index c11c62b..ff1f040 100644 --- a/internal/game/game.go +++ b/internal/game/game.go @@ -247,6 +247,9 @@ func (g *Game) PlayerAct(id int, cmd string) *Deck { if len(cmd_s) != 2 || !g.CanDraw { return nil } + if curr.Life == 0 { + return DeckFromCards(curr.Hand) + } x_i, err := strconv.Atoi(cmd_s[1]) if x_i > 2 || x_i < 0 { return nil