Fix handling finished acey-deucey games

This commit is contained in:
Trevor Slocum 2023-12-24 23:58:51 -08:00
parent 262d006c71
commit a2fb60cf35

View file

@ -950,6 +950,8 @@ COMMANDS:
if clientGame == nil {
cmd.client.sendNotice("You are not currently in a match.")
continue
} else if clientGame.Winner != 0 {
continue
}
if clientGame.Turn != cmd.client.playerNumber {
@ -992,6 +994,8 @@ COMMANDS:
if clientGame == nil {
cmd.client.sendNotice("You are not currently in a match.")
continue
} else if clientGame.Winner != 0 {
continue
}
gameState := &bgammon.GameState{
@ -1074,6 +1078,8 @@ COMMANDS:
Reason: "You are not currently in a match.",
})
continue
} else if clientGame.Winner != 0 {
continue
}
opponent := clientGame.opponent(cmd.client)
@ -1199,6 +1205,9 @@ COMMANDS:
Reason: "You are not currently in a match.",
})
continue
} else if clientGame.Winner != 0 {
clientGame.sendBoard(cmd.client)
continue
}
if clientGame.Turn != cmd.client.playerNumber {
@ -1379,6 +1388,8 @@ COMMANDS:
if clientGame == nil {
cmd.client.sendNotice("You are not currently in a match.")
continue
} else if clientGame.Winner != 0 {
continue
}
if clientGame.Turn != cmd.client.playerNumber {
@ -1413,6 +1424,8 @@ COMMANDS:
if clientGame == nil {
cmd.client.sendNotice("You are not currently in a match.")
continue
} else if clientGame.Winner != 0 {
continue
}
opponent := clientGame.opponent(cmd.client)