From 6f16a13051be3c9247f8061fd9d247e53fe2edfa Mon Sep 17 00:00:00 2001 From: Steve Date: Fri, 1 Oct 2021 21:14:53 -0400 Subject: [PATCH] dont allow playing from max hand size --- game.go | 2 +- go.mod | 3 +-- go.sum | 4 ++++ 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/game.go b/game.go index f3d5340..25b8e5f 100644 --- a/game.go +++ b/game.go @@ -369,7 +369,7 @@ func (g *Game) PlayerAct(id int, cmd string) *Deck { log.Println(err) return nil } - if x_i < 0 || x_i > len(curr.Hand) { + if x_i < 0 || x_i >= len(curr.Hand) { return nil } card := curr.Hand[x_i] diff --git a/go.mod b/go.mod index ba1c78e..58f6bb4 100644 --- a/go.mod +++ b/go.mod @@ -3,7 +3,6 @@ module git.saintnet.tech/tomecraft/tome_game go 1.16 require ( - git.saintnet.tech/tomecraft/tome_lib v0.1.1 // indirect + git.saintnet.tech/tomecraft/tome_lib v0.1.2 // indirect github.com/google/uuid v1.3.0 // indirect ) - diff --git a/go.sum b/go.sum index be95d08..9355e57 100644 --- a/go.sum +++ b/go.sum @@ -1,4 +1,8 @@ git.saintnet.tech/tomecraft/tome_lib v0.1.0 h1:c+AMtXgLKUFErrYFx7g8M2zVcrHUwLRY18v/+N8nn2I= git.saintnet.tech/tomecraft/tome_lib v0.1.0/go.mod h1:Jekqa9ojNDOrcO1aL0IWKuhCQSE5+MNHVcYtTWA6uko= +git.saintnet.tech/tomecraft/tome_lib v0.1.1 h1:WAX/9oQxkZeftWvy/dow00XUO+ZCp0/yOStCSL+T3nE= +git.saintnet.tech/tomecraft/tome_lib v0.1.1/go.mod h1:Jekqa9ojNDOrcO1aL0IWKuhCQSE5+MNHVcYtTWA6uko= +git.saintnet.tech/tomecraft/tome_lib v0.1.2 h1:S2BHgsWBGFv9fy+qBHuKXv0kcjT7VP/7gDmJHje/+RQ= +git.saintnet.tech/tomecraft/tome_lib v0.1.2/go.mod h1:Jekqa9ojNDOrcO1aL0IWKuhCQSE5+MNHVcYtTWA6uko= github.com/google/uuid v1.3.0 h1:t6JiXgmwXMjEs8VusXIJk2BXHsn+wx8BZdTaoZ5fu7I= github.com/google/uuid v1.3.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=