Skip to content

Commit e2e34aa

Browse files
committed
Allow accepting invalid goals
1 parent c7c9668 commit e2e34aa

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

internal/app/engine/process_continue_next_action.go

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -110,13 +110,17 @@ func (e *Engine) nextActions() (actions []*ContinueAction, hints []*ContinueHint
110110
func (e *Engine) actionsToContinueFromStop() (actions []*ContinueAction, hints []*ContinueHint) {
111111
for _, team := range state.BothTeams() {
112112
if e.currentState.HasGameEventByTeam(state.GameEvent_POSSIBLE_GOAL, team) &&
113-
!e.currentState.HasGameEventByTeam(state.GameEvent_GOAL, team) &&
114-
!e.currentState.HasGameEventByTeam(state.GameEvent_INVALID_GOAL, team) {
115-
actions = append(actions, createContinueAction(
113+
!e.currentState.HasGameEventByTeam(state.GameEvent_GOAL, team) {
114+
continueActionAcceptGoal := createContinueAction(
116115
ContinueAction_ACCEPT_GOAL,
117116
team,
118117
ContinueAction_READY_MANUAL,
119-
))
118+
)
119+
if e.currentState.HasGameEventByTeam(state.GameEvent_INVALID_GOAL, team) {
120+
continueActionAcceptGoal.ContinuationIssues = append(continueActionAcceptGoal.ContinuationIssues,
121+
"The goal was probably invalid")
122+
}
123+
actions = append(actions, continueActionAcceptGoal)
120124
}
121125

122126
challengeFlagsRaised := len(e.currentState.FindGameEventsByTeam(state.GameEvent_CHALLENGE_FLAG, team))

0 commit comments

Comments
 (0)