From 4b89816e900767541327662a06449a0af546ad52 Mon Sep 17 00:00:00 2001 From: David Thompson Date: Fri, 5 Feb 2016 13:37:11 -0500 Subject: 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. --- sly/live-reload.scm | 3 +++ 1 file changed, 3 insertions(+) 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. -- cgit v1.2.3