summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--scene/main/node.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/scene/main/node.cpp b/scene/main/node.cpp
index 0245944154..a59f3c3823 100644
--- a/scene/main/node.cpp
+++ b/scene/main/node.cpp
@@ -1719,6 +1719,9 @@ void Node::get_owned_by(Node *p_by, List<Node *> *p_owned) {
void Node::_set_owner_nocheck(Node *p_owner) {
+ if (data.owner == p_owner)
+ return;
+
ERR_FAIL_COND(data.owner);
data.owner = p_owner;
data.owner->data.owned.push_back(this);