diff options
author | cdemirer <41021322+cdemirer@users.noreply.github.com> | 2022-07-18 16:35:25 +0300 |
---|---|---|
committer | cdemirer <41021322+cdemirer@users.noreply.github.com> | 2022-07-18 16:35:25 +0300 |
commit | e9a5beeb01fe246b555ccf4b6ff0d90684cdddef (patch) | |
tree | e2ed23bc9ce4bfa28b0f4b9293d9498aef3d189d | |
parent | 9904a9db5a90f2f1896b6b7e1603ca2dd2745bad (diff) |
Fix crash while trying to autocomplete non-global Autoload
-rw-r--r-- | modules/gdscript/gdscript_editor.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/modules/gdscript/gdscript_editor.cpp b/modules/gdscript/gdscript_editor.cpp index 0a1e1a22fb..90dcfa307e 100644 --- a/modules/gdscript/gdscript_editor.cpp +++ b/modules/gdscript/gdscript_editor.cpp @@ -2004,8 +2004,8 @@ static bool _guess_identifier_type(GDScriptParser::CompletionContext &p_context, return false; } - // Check autoloads. - if (ProjectSettings::get_singleton()->has_autoload(p_identifier)) { + // Check global variables (including autoloads). + if (GDScriptLanguage::get_singleton()->get_named_globals_map().has(p_identifier)) { r_type = _type_from_variant(GDScriptLanguage::get_singleton()->get_named_globals_map()[p_identifier]); return true; } |