From aebbbda08060e0cd130c5a682cd91b6babb18c67 Mon Sep 17 00:00:00 2001 From: Danil Alexeev Date: Tue, 16 May 2023 13:03:53 +0300 Subject: GDScript: Fix some bugs with static variables and functions --- modules/gdscript/gdscript_disassembler.cpp | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) (limited to 'modules/gdscript/gdscript_disassembler.cpp') diff --git a/modules/gdscript/gdscript_disassembler.cpp b/modules/gdscript/gdscript_disassembler.cpp index cf33f12e3a..0438bd8903 100644 --- a/modules/gdscript/gdscript_disassembler.cpp +++ b/modules/gdscript/gdscript_disassembler.cpp @@ -312,6 +312,36 @@ void GDScriptFunction::disassemble(const Vector &p_code_lines) const { incr += 3; } break; + case OPCODE_SET_STATIC_VARIABLE: { + text += "set_static_variable script("; + Ref gdscript = get_constant(_code_ptr[ip + 2] & GDScriptFunction::ADDR_MASK); + text += gdscript.is_valid() ? gdscript->get_fully_qualified_name().get_file() : ""; + text += ")"; + if (gdscript.is_valid()) { + text += "[\"" + gdscript->debug_get_static_var_by_index(_code_ptr[ip + 3]) + "\"]"; + } else { + text += "[]"; + } + text += " = "; + text += DADDR(1); + + incr += 4; + } break; + case OPCODE_GET_STATIC_VARIABLE: { + text += "get_static_variable "; + text += DADDR(1); + text += " = script("; + Ref gdscript = get_constant(_code_ptr[ip + 2] & GDScriptFunction::ADDR_MASK); + text += gdscript.is_valid() ? gdscript->get_fully_qualified_name().get_file() : ""; + text += ")"; + if (gdscript.is_valid()) { + text += "[\"" + gdscript->debug_get_static_var_by_index(_code_ptr[ip + 3]) + "\"]"; + } else { + text += "[]"; + } + + incr += 4; + } break; case OPCODE_ASSIGN: { text += "assign "; text += DADDR(1); -- cgit v1.2.3