Skip to content

Commit

Permalink
Clarify pause condition
Browse files Browse the repository at this point in the history
  • Loading branch information
xsebek committed Sep 9, 2024
1 parent 8ea3d27 commit 3d00eff
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/swarm-engine/Swarm/Game/Step.hs
Original file line number Diff line number Diff line change
Expand Up @@ -342,7 +342,9 @@ hypotheticalWinCheck em g ws oc = do
queue <- messageInfo . announcementQueue Swarm.Util.<%= (>< Seq.fromList (map ObjectiveCompleted $ completionAnnouncementQueue finalAccumulator))
shouldPause <- use $ temporal . pauseOnObjective

when (newWinState /= Ongoing || (notNull queue && shouldPause == PauseOnAnyObjective)) $
let gameFinished = newWinState /= Ongoing
let finishedObjectives = notNull queue
when (gameFinished || (finishedObjectives && shouldPause == PauseOnAnyObjective)) $
temporal . runStatus .= AutoPause

mapM_ handleException $ exceptions finalAccumulator
Expand Down

0 comments on commit 3d00eff

Please sign in to comment.