diff options
author | Rémi Verschelde <rverschelde@gmail.com> | 2023-01-03 23:22:23 +0100 |
---|---|---|
committer | Rémi Verschelde <rverschelde@gmail.com> | 2023-01-03 23:22:23 +0100 |
commit | 8203e093302fa2c8862dbad7dbade6731468e5e4 (patch) | |
tree | 6847c93898b0e42c367db4d8a26c3e8f68b27fec /modules/gdscript/gdscript_analyzer.cpp | |
parent | 565ae3b76791ba707a5a18be50be336533ef0857 (diff) | |
parent | 961b4ac5f5f2279a5ce67341bb89db859ba9d40d (diff) | |
download | redot-engine-8203e093302fa2c8862dbad7dbade6731468e5e4.tar.gz |
Merge pull request #70859 from vonagam/fix-preload-native-type
GDScript: Fix wrong native type for preloaded class
Diffstat (limited to 'modules/gdscript/gdscript_analyzer.cpp')
-rw-r--r-- | modules/gdscript/gdscript_analyzer.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/modules/gdscript/gdscript_analyzer.cpp b/modules/gdscript/gdscript_analyzer.cpp index 757e602ebe..ad20672e2d 100644 --- a/modules/gdscript/gdscript_analyzer.cpp +++ b/modules/gdscript/gdscript_analyzer.cpp @@ -3998,10 +3998,8 @@ GDScriptParser::DataType GDScriptAnalyzer::type_from_variant(const Variant &p_va scr = obj->get_script(); } if (scr.is_valid()) { - result.script_path = scr->get_path(); Ref<GDScript> gds = scr; if (gds.is_valid()) { - result.kind = GDScriptParser::DataType::CLASS; // This might be an inner class, so we want to get the parser for the root. // But still get the inner class from that tree. String script_path = gds->get_script_path(); @@ -4027,11 +4025,14 @@ GDScriptParser::DataType GDScriptAnalyzer::type_from_variant(const Variant &p_va return error_type; } + result.kind = GDScriptParser::DataType::CLASS; + result.native_type = found->get_datatype().native_type; result.class_type = found; result.script_path = ref->get_parser()->script_path; } else { result.kind = GDScriptParser::DataType::SCRIPT; result.native_type = scr->get_instance_base_type(); + result.script_path = scr->get_path(); } result.script_type = scr; } else { |