Disallow doubling higher than 64
This commit is contained in:
parent
3d520fd32b
commit
78fdbe2206
3 changed files with 4 additions and 4 deletions
|
@ -87,7 +87,7 @@ func (g *GameState) Pips(player int8) int {
|
|||
|
||||
// MayDouble returns whether the player may send the 'double' command.
|
||||
func (g *GameState) MayDouble() bool {
|
||||
if g.Spectating || g.Winner != 0 || g.Variant != VariantBackgammon {
|
||||
if g.Spectating || g.Winner != 0 || g.Variant != VariantBackgammon || g.DoubleValue == 64 {
|
||||
return false
|
||||
}
|
||||
return g.Points != 1 && g.Turn != 0 && g.Turn == g.PlayerNumber && g.Roll1 == 0 && !g.DoubleOffered && (g.DoublePlayer == 0 || g.DoublePlayer == g.PlayerNumber)
|
||||
|
|
2
go.mod
2
go.mod
|
@ -3,7 +3,7 @@ module code.rocket9labs.com/tslocum/bgammon
|
|||
go 1.17
|
||||
|
||||
require (
|
||||
code.rocket9labs.com/tslocum/gotext v0.0.0-20240722063358-6067ad4d7a58
|
||||
code.rocket9labs.com/tslocum/gotext v0.0.0-20240728181248-46f419ff143b
|
||||
code.rocket9labs.com/tslocum/tabula v0.0.0-20240703054156-ce0b448f0999
|
||||
github.com/alexedwards/argon2id v1.0.0
|
||||
github.com/gorilla/mux v1.8.1
|
||||
|
|
4
go.sum
4
go.sum
|
@ -1,7 +1,7 @@
|
|||
code.rocket9labs.com/tslocum/bei v0.0.0-20240108012722-6db380cc190b h1:Y0a14Kf/hSYepSmp4ZfDeE4CZZGBGBS97CNjCbKJm0c=
|
||||
code.rocket9labs.com/tslocum/bei v0.0.0-20240108012722-6db380cc190b/go.mod h1:tS60/VNAJphKvDBkSLQhKALa15msIAuWWfEKNc4oFZc=
|
||||
code.rocket9labs.com/tslocum/gotext v0.0.0-20240722063358-6067ad4d7a58 h1:8A+LPX/j9qYaE/tSJcaYONIh28JX5CN9i+4ZfRefvPo=
|
||||
code.rocket9labs.com/tslocum/gotext v0.0.0-20240722063358-6067ad4d7a58/go.mod h1:ZkYZ/IF/ebzhUL2bNp4ALROsuH9iCztUWvUJBWsHXRU=
|
||||
code.rocket9labs.com/tslocum/gotext v0.0.0-20240728181248-46f419ff143b h1:KSdR7VPoftY5Bt+osGRBbtHlCWxhe1QbOuf58CG7ieI=
|
||||
code.rocket9labs.com/tslocum/gotext v0.0.0-20240728181248-46f419ff143b/go.mod h1:ZkYZ/IF/ebzhUL2bNp4ALROsuH9iCztUWvUJBWsHXRU=
|
||||
code.rocket9labs.com/tslocum/tabula v0.0.0-20240703054156-ce0b448f0999 h1:PwfoDBtxVT3TwL2KpoijPKi6NQsGu6cXhPVoQeqKJWM=
|
||||
code.rocket9labs.com/tslocum/tabula v0.0.0-20240703054156-ce0b448f0999/go.mod h1:WEJXESKXqrMFLAArikQ79lpRibNeeE1C0VruxXYMF5M=
|
||||
github.com/Masterminds/goutils v1.1.1 h1:5nUrii3FMTL5diU80unEVvNevw1nH4+ZV4DSLVJLSYI=
|
||||
|
|
Loading…
Reference in a new issue