File tree Expand file tree Collapse file tree 1 file changed +7
-5
lines changed Expand file tree Collapse file tree 1 file changed +7
-5
lines changed Original file line number Diff line number Diff line change @@ -2800,10 +2800,13 @@ void EditorPropertyNodePath::_text_submitted(const String &p_text) {
2800
2800
}
2801
2801
2802
2802
const NodePath EditorPropertyNodePath::_get_node_path () const {
2803
- const Node *base_node = const_cast <EditorPropertyNodePath *>(this )->get_base_node ();
2804
-
2805
2803
Variant val = get_edited_property_value ();
2806
- Node *n = Object::cast_to<Node>(val);
2804
+ if (val.get_type () == Variant::NODE_PATH) {
2805
+ return val;
2806
+ }
2807
+
2808
+ const Node *base_node = const_cast <EditorPropertyNodePath *>(this )->get_base_node ();
2809
+ const Node *n = Object::cast_to<Node>(val.get_validated_object ());
2807
2810
if (n) {
2808
2811
if (!n->is_inside_tree ()) {
2809
2812
return NodePath ();
@@ -2813,9 +2816,8 @@ const NodePath EditorPropertyNodePath::_get_node_path() const {
2813
2816
} else {
2814
2817
return get_tree ()->get_edited_scene_root ()->get_path_to (n);
2815
2818
}
2816
- } else {
2817
- return val;
2818
2819
}
2820
+ return NodePath ();
2819
2821
}
2820
2822
2821
2823
bool EditorPropertyNodePath::can_drop_data_fw (const Point2 &p_point, const Variant &p_data, Control *p_from) const {
You can’t perform that action at this time.
0 commit comments