diff options
Diffstat (limited to 'modules/gdscript')
-rw-r--r-- | modules/gdscript/doc_classes/@GDScript.xml | 5 | ||||
-rw-r--r-- | modules/gdscript/gdscript.cpp | 3 | ||||
-rw-r--r-- | modules/gdscript/gdscript_functions.cpp | 20 |
3 files changed, 8 insertions, 20 deletions
diff --git a/modules/gdscript/doc_classes/@GDScript.xml b/modules/gdscript/doc_classes/@GDScript.xml index d1f52d2422..502a68cd61 100644 --- a/modules/gdscript/doc_classes/@GDScript.xml +++ b/modules/gdscript/doc_classes/@GDScript.xml @@ -616,9 +616,10 @@ Loads a resource from the filesystem located at [code]path[/code]. [b]Note:[/b] Resource paths can be obtained by right-clicking on a resource in the FileSystem dock and choosing [b]Copy Path[/b]. [codeblock] - # Load a scene called main located in the root of the project directory + # Load a scene called main located in the root of the project directory. var main = load("res://main.tscn") [/codeblock] + [b]Important:[/b] The path must be absolute, a local path will just return [code]null[/code]. </description> </method> <method name="log"> @@ -786,7 +787,7 @@ Returns a resource from the filesystem that is loaded during script parsing. [b]Note:[/b] Resource paths can be obtained by right clicking on a resource in the Assets Panel and choosing "Copy Path". [codeblock] - # Load a scene called main located in the root of the project directory + # Load a scene called main located in the root of the project directory. var main = preload("res://main.tscn") [/codeblock] </description> diff --git a/modules/gdscript/gdscript.cpp b/modules/gdscript/gdscript.cpp index 563f7e2471..2f620df8fb 100644 --- a/modules/gdscript/gdscript.cpp +++ b/modules/gdscript/gdscript.cpp @@ -2143,7 +2143,8 @@ GDScriptLanguage::GDScriptLanguage() { GLOBAL_DEF("debug/gdscript/completion/autocomplete_setters_and_getters", false); for (int i = 0; i < (int)GDScriptWarning::WARNING_MAX; i++) { String warning = GDScriptWarning::get_name_from_code((GDScriptWarning::Code)i).to_lower(); - GLOBAL_DEF("debug/gdscript/warnings/" + warning, !warning.begins_with("unsafe_")); + bool default_enabled = !warning.begins_with("unsafe_") && i != GDScriptWarning::UNUSED_CLASS_VARIABLE; + GLOBAL_DEF("debug/gdscript/warnings/" + warning, default_enabled); } #endif // DEBUG_ENABLED } diff --git a/modules/gdscript/gdscript_functions.cpp b/modules/gdscript/gdscript_functions.cpp index bbafef68ed..9e05c7b574 100644 --- a/modules/gdscript/gdscript_functions.cpp +++ b/modules/gdscript/gdscript_functions.cpp @@ -1128,25 +1128,11 @@ void GDScriptFunctions::call(Function p_func, const Variant **p_args, int p_arg_ d["@subpath"] = cp; d["@path"] = p->get_path(); - p = base.ptr(); - - while (p) { - - for (Set<StringName>::Element *E = p->members.front(); E; E = E->next()) { - - Variant value; - if (ins->get(E->get(), value)) { - - String k = E->get(); - if (!d.has(k)) { - d[k] = value; - } - } + for (Map<StringName, GDScript::MemberInfo>::Element *E = base->member_indices.front(); E; E = E->next()) { + if (!d.has(E->key())) { + d[E->key()] = ins->members[E->get().index]; } - - p = p->_base; } - r_ret = d; } } |