summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Thompson <dthompson2@worcester.edu>2016-02-05 13:37:11 -0500
committerDavid Thompson <dthompson2@worcester.edu>2016-02-05 13:37:26 -0500
commit4b89816e900767541327662a06449a0af546ad52 (patch)
treedc8e9c2521c0e702df50f7a6865af92d2d0b6521
parentb1513f3640a47a17a4b00c9f6e7f575bfd514619 (diff)
live-reload: Don't load anything if the game hasn't started.
* sly/live-reload (with-live-reload): Ignore poll when game has not yet started.
-rw-r--r--sly/live-reload.scm3
1 files changed, 3 insertions, 0 deletions
diff --git a/sly/live-reload.scm b/sly/live-reload.scm
index cb40e7c..bb828e8 100644
--- a/sly/live-reload.scm
+++ b/sly/live-reload.scm
@@ -25,6 +25,7 @@
#:use-module (srfi srfi-1)
#:use-module (sly agenda)
#:use-module (sly coroutine)
+ #:use-module (sly game)
#:use-module (sly signal)
#:export (watch-files
with-live-reload))
@@ -48,6 +49,8 @@ polled for changes, defaulting to two seconds."
(wait polling-interval)
(let ((mtime (max-current-mtime)))
(when (cond
+ ;; Game hasn't started yet.
+ ((not (signal-ref game-started?)) #f)
;; Some files do not exist anymore, can't reload.
((not mtime) #f)
;; Some files were missing, but are back now.