summaryrefslogtreecommitdiff
path: root/starling/node.scm
diff options
context:
space:
mode:
authorDavid Thompson <dthompson@vistahigherlearning.com>2020-12-15 11:42:25 -0500
committerDavid Thompson <dthompson@vistahigherlearning.com>2020-12-15 11:42:25 -0500
commitb4de83ce32e382dd85cad0cc5bb697dd691e2dde (patch)
tree521bb2b0ebce269a1d7ce2ff3dfb499fd0f28dfb /starling/node.scm
parent9af0cf20103ec60c910e4d598c368b788ec2217e (diff)
node: Improve boot logic.
Diffstat (limited to 'starling/node.scm')
-rw-r--r--starling/node.scm11
1 files changed, 7 insertions, 4 deletions
diff --git a/starling/node.scm b/starling/node.scm
index 17fd177..631f113 100644
--- a/starling/node.scm
+++ b/starling/node.scm
@@ -155,8 +155,9 @@ represented as a ratio in the range [0, 1]."
(define-method (boot (node <node>))
"Prepare NODE to enter the game world for the first time."
- (set! (booted? node) #t)
- (on-boot node))
+ (unless (booted? node)
+ (set! (booted? node) #t)
+ (on-boot node)))
(define-method (reboot (node <node>))
(define (do-reboot)
@@ -249,8 +250,10 @@ represented as a ratio in the range [0, 1]."
;; Add to name index.
(when (name child)
(hashq-set! (children-by-name new-parent) (name child) child))
- ;; If the parent is active, that means the new children
- ;; must also be active.
+ ;; If the parent is booted or active, that means the new
+ ;; children must also be booted or activated.
+ (when (booted? new-parent)
+ (boot child))
(when (active? new-parent)
(activate child)))
new-children)