Merge pull request #63560 from V-Sekai/named_global_crashfix

This commit is contained in:
Rémi Verschelde 2022-07-28 09:03:01 +02:00 committed by GitHub
commit fb086d44cf
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -3295,6 +3295,7 @@ Variant GDScriptFunction::call(GDScriptInstance *p_instance, const Variant **p_a
int globalname_idx = _code_ptr[ip + 2];
GD_ERR_BREAK(globalname_idx < 0 || globalname_idx >= _global_names_count);
const StringName *globalname = &_global_names_ptr[globalname_idx];
GD_ERR_BREAK(!GDScriptLanguage::get_singleton()->get_named_globals_map().has(*globalname));
GET_INSTRUCTION_ARG(dst, 0);
*dst = GDScriptLanguage::get_singleton()->get_named_globals_map()[*globalname];