diff options
author | Rémi Verschelde <remi@verschelde.fr> | 2021-09-13 21:10:34 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-09-13 21:10:34 +0200 |
commit | ffe8412291958a3e920dda7c5134953f8c721fe1 (patch) | |
tree | b78cd3a32d8db7ee6cd394d54cfd62f8fb4017f1 /modules/gdscript/gdscript_vm.cpp | |
parent | feba85a569c1d3c2411f721e11d081e6abf9c8de (diff) | |
parent | 3d135880572ae863b4de250bc2da8edac701c020 (diff) | |
download | redot-engine-ffe8412291958a3e920dda7c5134953f8c721fe1.tar.gz |
Merge pull request #52323 from vnen/gdscript-singleton-interdependence-fix
Fix loading of interdependent autoloads
Diffstat (limited to 'modules/gdscript/gdscript_vm.cpp')
-rw-r--r-- | modules/gdscript/gdscript_vm.cpp | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/modules/gdscript/gdscript_vm.cpp b/modules/gdscript/gdscript_vm.cpp index 882256b7e3..64fd7eca8a 100644 --- a/modules/gdscript/gdscript_vm.cpp +++ b/modules/gdscript/gdscript_vm.cpp @@ -322,6 +322,7 @@ void (*type_init_function_table[])(Variant *) = { &&OPCODE_ITERATE_PACKED_VECTOR3_ARRAY, \ &&OPCODE_ITERATE_PACKED_COLOR_ARRAY, \ &&OPCODE_ITERATE_OBJECT, \ + &&OPCODE_STORE_GLOBAL, \ &&OPCODE_STORE_NAMED_GLOBAL, \ &&OPCODE_TYPE_ADJUST_BOOL, \ &&OPCODE_TYPE_ADJUST_INT, \ @@ -3116,6 +3117,18 @@ Variant GDScriptFunction::call(GDScriptInstance *p_instance, const Variant **p_a } DISPATCH_OPCODE; + OPCODE(OPCODE_STORE_GLOBAL) { + CHECK_SPACE(3); + int global_idx = _code_ptr[ip + 2]; + GD_ERR_BREAK(global_idx < 0 || global_idx >= GDScriptLanguage::get_singleton()->get_global_array_size()); + + GET_INSTRUCTION_ARG(dst, 0); + *dst = GDScriptLanguage::get_singleton()->get_global_array()[global_idx]; + + ip += 3; + } + DISPATCH_OPCODE; + OPCODE(OPCODE_STORE_NAMED_GLOBAL) { CHECK_SPACE(3); int globalname_idx = _code_ptr[ip + 2]; |