summaryrefslogtreecommitdiff
path: root/scene/2d/joint_2d.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'scene/2d/joint_2d.cpp')
-rw-r--r--scene/2d/joint_2d.cpp18
1 files changed, 14 insertions, 4 deletions
diff --git a/scene/2d/joint_2d.cpp b/scene/2d/joint_2d.cpp
index 89b6f3f9da..8de4c281f4 100644
--- a/scene/2d/joint_2d.cpp
+++ b/scene/2d/joint_2d.cpp
@@ -133,7 +133,13 @@ void Joint2D::set_node_a(const NodePath &p_node_a) {
}
a = p_node_a;
- _update_joint();
+ if (Engine::get_singleton()->is_editor_hint()) {
+ // When in editor, the setter may be called as a result of node rename.
+ // It happens before the node actually changes its name, which triggers false warning.
+ callable_mp(this, &Joint2D::_update_joint).call_deferred();
+ } else {
+ _update_joint();
+ }
}
NodePath Joint2D::get_node_a() const {
@@ -150,7 +156,11 @@ void Joint2D::set_node_b(const NodePath &p_node_b) {
}
b = p_node_b;
- _update_joint();
+ if (Engine::get_singleton()->is_editor_hint()) {
+ callable_mp(this, &Joint2D::_update_joint).call_deferred();
+ } else {
+ _update_joint();
+ }
}
NodePath Joint2D::get_node_b() const {
@@ -202,8 +212,8 @@ bool Joint2D::get_exclude_nodes_from_collision() const {
return exclude_from_collision;
}
-TypedArray<String> Joint2D::get_configuration_warnings() const {
- TypedArray<String> warnings = Node2D::get_configuration_warnings();
+PackedStringArray Joint2D::get_configuration_warnings() const {
+ PackedStringArray warnings = Node2D::get_configuration_warnings();
if (!warning.is_empty()) {
warnings.push_back(warning);