Skip to content

Commit

Permalink
GH-646 Allow return nodes to be duplicated
Browse files Browse the repository at this point in the history
  • Loading branch information
Naros committed Aug 3, 2024
1 parent 2b8dad5 commit 218f205
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 11 deletions.
1 change: 0 additions & 1 deletion src/script/nodes/functions/function_result.h
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,6 @@ class OScriptNodeFunctionResult : public OScriptNodeFunctionTerminator
bool is_compatible_with_graph(const Ref<OScriptGraph>& p_graph) const override;
void post_placed_new_node() override;
bool can_user_delete_node() const override;
bool can_duplicate() const override { return false; }
OScriptNodeInstance* instantiate() override;
//~ End OScriptNode Interface

Expand Down
15 changes: 5 additions & 10 deletions src/script/nodes/functions/function_terminator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
#include "function_terminator.h"

#include "common/dictionary_utils.h"
#include "common/macros.h"
#include "common/property_utils.h"
#include "common/variant_utils.h"

Expand Down Expand Up @@ -157,11 +158,8 @@ void OScriptNodeFunctionTerminator::post_initialize()
super::post_initialize();

_function = get_orchestration()->find_function(_guid);
if (_function.is_valid())
{
if (_is_in_editor())
_function->connect("changed", callable_mp(this, &OScriptNodeFunctionTerminator::_on_function_changed));
}
if (_function.is_valid() && _is_in_editor())
OCONNECT(_function, "changed", callable_mp(this, &OScriptNodeFunctionTerminator::_on_function_changed));

// Always reconstruct entry/exit nodes
reconstruct_node();
Expand All @@ -171,9 +169,6 @@ void OScriptNodeFunctionTerminator::post_placed_new_node()
{
super::post_placed_new_node();

if (_function.is_valid())
{
if (_is_in_editor())
_function->connect("changed", callable_mp(this, &OScriptNodeFunctionTerminator::_on_function_changed));
}
if (_function.is_valid() && _is_in_editor())
OCONNECT(_function, "changed", callable_mp(this, &OScriptNodeFunctionTerminator::_on_function_changed));
}

0 comments on commit 218f205

Please sign in to comment.