diff options
author | TechnoPorg <jonah.janzen@gmail.com> | 2022-01-25 08:37:41 -0700 |
---|---|---|
committer | TechnoPorg <jonah.janzen@gmail.com> | 2022-01-25 09:03:36 -0700 |
commit | 051ef479c93c0c830b60059e3dabed6fc381cdd6 (patch) | |
tree | 7e934e5aaa141e00de5d4a45ee7d92f4b9f6eb02 /editor/editor_properties.cpp | |
parent | 2f4d76f068b29783bde653406b51909b29a082a3 (diff) |
Allow method binds to take Object subclasses as arguments
This commit adds a condition to VariantCaster that casts Variants of type OBJECT to any type T, if T is derived from Object.
This change enables a fair bit of code cleanup. First, the Variant implicit cast operators for Node and Control can be removed, which allows for some invalid includes to be removed. Second, helper methods in Tree whose sole purpose was to cast arguments to TreeItem * are no longer necessary.
A few small changes also had to be made to other files, due to the changes cascading down all the includes.
Diffstat (limited to 'editor/editor_properties.cpp')
-rw-r--r-- | editor/editor_properties.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/editor/editor_properties.cpp b/editor/editor_properties.cpp index 97a38b9200..e00dd698b6 100644 --- a/editor/editor_properties.cpp +++ b/editor/editor_properties.cpp @@ -2695,7 +2695,7 @@ void EditorPropertyNodePath::_node_selected(const NodePath &p_path) { } if (!base_node && get_edited_object()->has_method("get_root_path")) { - base_node = get_edited_object()->call("get_root_path"); + base_node = Object::cast_to<Node>(get_edited_object()->call("get_root_path")); } if (!base_node && Object::cast_to<RefCounted>(get_edited_object())) { |