Avoid caching turn past a user action (which causes problems if we suspend/resume across turns)

This commit is contained in:
Tony Garnock-Jones 2021-06-11 09:57:35 +02:00
parent 4970d0fd9e
commit 5e1518c2bb
1 changed files with 7 additions and 6 deletions

View File

@ -484,13 +484,14 @@
(define (stop-if-inert-after action) (define (stop-if-inert-after action)
(lambda () (lambda ()
(define turn (current-turn)) (define f (turn-active-facet (current-turn)))
(define f (turn-active-facet turn))
(action) (action)
(turn-enqueue! turn f (lambda () (turn-enqueue! (current-turn)
(when (or (and (facet-parent f) (not (facet-live? (facet-parent f)))) f
(facet-inert? f)) (lambda ()
(turn-stop! (current-turn))))))) (when (or (and (facet-parent f) (not (facet-live? (facet-parent f))))
(facet-inert? f))
(turn-stop! (current-turn)))))))
(define (deliver maybe-proc . args) (define (deliver maybe-proc . args)
(when maybe-proc (when maybe-proc