You've already forked godot
mirror of
https://github.com/godotengine/godot.git
synced 2026-01-07 19:53:17 +00:00
Merge pull request #102451 from ryevdokimov/add-fail-cond-msg-reparent-self
Add `ERR_FAIL_COND_MSG` for reparenting to self
This commit is contained in:
@@ -1954,6 +1954,7 @@ void Node::reparent(Node *p_parent, bool p_keep_global_transform) {
|
||||
ERR_THREAD_GUARD
|
||||
ERR_FAIL_NULL(p_parent);
|
||||
ERR_FAIL_NULL_MSG(data.parent, "Node needs a parent to be reparented.");
|
||||
ERR_FAIL_COND_MSG(p_parent == this, vformat("Can't reparent '%s' to itself.", p_parent->get_name()));
|
||||
|
||||
if (p_parent == data.parent) {
|
||||
return;
|
||||
|
||||
Reference in New Issue
Block a user