From 46473ee8ce053a4110ac84f8dc0956dec71a5152 Mon Sep 17 00:00:00 2001 From: ~keith Date: Tue, 14 Dec 2021 22:16:42 +0000 Subject: [PATCH] Don't fire [component (parent-activated)] when the actor is still blocked (for #2) --- wh-engine/actor.lisp | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/wh-engine/actor.lisp b/wh-engine/actor.lisp index 21c3210..abb7855 100644 --- a/wh-engine/actor.lisp +++ b/wh-engine/actor.lisp @@ -151,11 +151,12 @@ (defmethod parent-activated ((this actor) parent) "Called when the actor's parent is activated." [this (recompute-blocked-p)] - (loop for child-ptr in [this children] - for child = (weak-pointer-value child-ptr) - do [child (parent-activated parent)]) - (loop for component in [this components] - do [component (parent-activated parent)])) + (when [this tree-active-p] + (loop for child-ptr in [this children] + for child = (weak-pointer-value child-ptr) + do [child (parent-activated parent)]) + (loop for component in [this components] + do [component (parent-activated parent)]))) (defmethod parent-changed ((this actor)) "Called when the actor's parent is changed."