Fix: bot opening the same card over and over

This commit is contained in:
Grail Finder
2025-06-29 16:48:10 +03:00
parent 598d141818
commit e375d7c689
3 changed files with 10 additions and 5 deletions

View File

@ -86,7 +86,7 @@ func HandleShowColor(w http.ResponseWriter, r *http.Request) {
fi.Room.ClearMarks()
}
switch string(color) {
case "black":
case string(models.WordColorBlack):
log.Debug("opened black word", "room", fi.Room)
// game over
fi.Room.IsRunning = false
@ -102,7 +102,7 @@ func HandleShowColor(w http.ResponseWriter, r *http.Request) {
fi.Room.ThisTurnLimit = 0
fi.Room.ActionHistory = append(fi.Room.ActionHistory, action)
fi.Room.ClearMarks()
case "white", string(oppositeColor):
case string(models.WordColorWhite), string(oppositeColor):
log.Debug("opened opposite color word", "room", fi.Room, "opposite-color", oppositeColor)
// end turn
fi.Room.TeamTurn = oppositeColor