Skip to content

Commit 74784bd

Browse files
committed
Fix: Show accept goal button in halt only
This way, the button is not kept showing as first option during stop and hindering automatic continuation.
1 parent 41d2250 commit 74784bd

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

internal/app/engine/process_continue_next_action.go

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,8 +109,11 @@ func (e *Engine) nextActions() (actions []*ContinueAction, hints []*ContinueHint
109109

110110
func (e *Engine) actionsToContinueFromStop() (actions []*ContinueAction, hints []*ContinueHint) {
111111
for _, team := range state.BothTeams() {
112-
if e.currentState.HasGameEventByTeam(state.GameEvent_POSSIBLE_GOAL, team) &&
112+
if e.currentState.GameState.IsHalted() &&
113+
e.currentState.HasGameEventByTeam(state.GameEvent_POSSIBLE_GOAL, team) &&
113114
!e.currentState.HasGameEventByTeam(state.GameEvent_GOAL, team) {
115+
// suggest accepting goal only in halt. This way, if it should be ignored (especially when goal was invalid)
116+
// then the continue button is rather annoying in STOP state
114117
continueActionAcceptGoal := createContinueAction(
115118
ContinueAction_ACCEPT_GOAL,
116119
team,

0 commit comments

Comments
 (0)