Skip to content

Commit

Permalink
Fix: Show accept goal button in halt only
Browse files Browse the repository at this point in the history
This way, the button is not kept showing as first option during stop and hindering automatic continuation.
  • Loading branch information
g3force committed Apr 11, 2024
1 parent 41d2250 commit 74784bd
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion internal/app/engine/process_continue_next_action.go
Original file line number Diff line number Diff line change
Expand Up @@ -109,8 +109,11 @@ func (e *Engine) nextActions() (actions []*ContinueAction, hints []*ContinueHint

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

0 comments on commit 74784bd

Please sign in to comment.