Cope with quit-world in the middle of an action sequence; TODO: unclear whether this is the best approach

This commit is contained in:
Tony Garnock-Jones 2015-10-23 21:49:21 -04:00
parent 974c21e5d0
commit 212900bc1a
1 changed files with 1 additions and 0 deletions

View File

@ -293,6 +293,7 @@
(define (perform-actions w)
(for/fold ([wt (transition (struct-copy world w [pending-action-queue (make-queue)]) '())])
((entry (in-list (queue->list (world-pending-action-queue w)))))
#:break (quit? wt) ;; TODO: should a quit action be delayed until the end of the turn?
(match-define [cons label a] entry)
(trace-internal-action label a (transition-state wt))
(define wt1 (transition-bind (perform-action label a) wt))