Fixed an oversight in how correct process_mode to use for invoked CallableNode is resolved.

This commit is contained in:
blujai831 2024-01-02 22:03:46 -08:00
parent 48a84ac85b
commit 47b4c1f17a
No known key found for this signature in database
GPG Key ID: DDC31A0363AA5E66
1 changed files with 8 additions and 6 deletions

View File

@ -15,9 +15,11 @@ var result: Variant = null
## 2. the CallableNode is passed the given args and opts;
## 3. the CallableNode is requested to call _ready,
## and then added as a child to the parent;
## 4. if the CallableNode's process_mode is PROCESS_MODE_INHERIT,
## the inherited process mode of the CallableNode is resolved,
## and its process_mode is set directly to that;
## 4. if the CallableNode's process_mode is PROCESS_MODE_INHERIT
## or PROCESS_MODE_DISABLED, the most descended process_mode
## in its ancestry not to equal either of those values
## is applied directly to the CallableNode instead
## (falling back to PROCESS_MODE_PAUSABLE if none is found);
## 5. the parent's process mode is set to PROCESS_MODE_DISABLED;
## 6. the function yields until the CallableNode is exiting the tree;
## 7. steps 2-5 are undone;
@ -42,9 +44,9 @@ func invoke_existing(
parent.add_child(self)
# step 4
var process_mode_resolve := self
while (
process_mode_resolve and
process_mode_resolve.process_mode == Node.PROCESS_MODE_INHERIT
while process_mode_resolve and (
process_mode_resolve.process_mode == Node.PROCESS_MODE_INHERIT or
process_mode_resolve.process_mode == Node.PROCESS_MODE_DISABLED
):
process_mode_resolve = process_mode_resolve.get_parent()
if process_mode_resolve: