Skip to content

Commit

Permalink
GH-646 Only reset return value when last return node removed
Browse files Browse the repository at this point in the history
  • Loading branch information
Naros committed Aug 3, 2024
1 parent 1f92561 commit a0f141c
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/script/nodes/functions/function_result.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -49,10 +49,14 @@ class OScriptNodeFunctionResultInstance : public OScriptNodeInstance

void OScriptNodeFunctionResult::pre_remove()
{
// When this node is removed, clear the function's return value
// When this node is removed, clear the function's return value if this is the last return node
Ref<OScriptFunction> function = get_function();
if (function.is_valid())
_function->set_has_return_value(false);
{
Vector<Ref<OScriptNode>> return_nodes = function->get_return_nodes();
if (return_nodes.size() == 1)
_function->set_has_return_value(false);
}
}

void OScriptNodeFunctionResult::allocate_default_pins()
Expand Down

0 comments on commit a0f141c

Please sign in to comment.