Fix: last clue; give clue mime input
This commit is contained in:
@@ -228,7 +228,16 @@ func (r *Room) FetchLastClue() (*Action, error) {
|
||||
}
|
||||
|
||||
func (r *Room) FetchLastClueWord() string {
|
||||
for i := len(r.ActionHistory) - 1; i >= 0; i-- {
|
||||
if len(r.ActionHistory) > 1 {
|
||||
if strings.EqualFold(r.ActionHistory[0].Action, ActionTypeGameStarted) {
|
||||
for i := len(r.ActionHistory) - 1; i >= 0; i-- {
|
||||
if r.ActionHistory[i].Action == string(ActionTypeClue) {
|
||||
return r.ActionHistory[i].Word
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
for i := 0; i <= len(r.ActionHistory)-1; i++ {
|
||||
if r.ActionHistory[i].Action == string(ActionTypeClue) {
|
||||
return r.ActionHistory[i].Word
|
||||
}
|
||||
|
Reference in New Issue
Block a user