dont allow playing from max hand size

This commit is contained in:
stryan 2021-10-01 21:14:53 -04:00
parent 36013e0b89
commit 6f16a13051
3 changed files with 6 additions and 3 deletions

View File

@ -369,7 +369,7 @@ func (g *Game) PlayerAct(id int, cmd string) *Deck {
log.Println(err) log.Println(err)
return nil return nil
} }
if x_i < 0 || x_i > len(curr.Hand) { if x_i < 0 || x_i >= len(curr.Hand) {
return nil return nil
} }
card := curr.Hand[x_i] card := curr.Hand[x_i]

3
go.mod
View File

@ -3,7 +3,6 @@ module git.saintnet.tech/tomecraft/tome_game
go 1.16 go 1.16
require ( 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 github.com/google/uuid v1.3.0 // indirect
) )

4
go.sum
View File

@ -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 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.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 h1:t6JiXgmwXMjEs8VusXIJk2BXHsn+wx8BZdTaoZ5fu7I=
github.com/google/uuid v1.3.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/google/uuid v1.3.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=