summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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)