diff options
author | Rémi Verschelde <rverschelde@gmail.com> | 2023-06-19 21:18:18 +0200 |
---|---|---|
committer | Rémi Verschelde <rverschelde@gmail.com> | 2023-06-19 21:18:18 +0200 |
commit | ae00187b58cc5ec20ceb2c00c912820c756ed275 (patch) | |
tree | ea7afe68cf0826268484d2d8f1d5029ec6e049d4 /modules/gdscript/gdscript_disassembler.cpp | |
parent | 5f9175f969807410bc077fc9caa0fa53febd4319 (diff) | |
parent | aebbbda08060e0cd130c5a682cd91b6babb18c67 (diff) | |
download | redot-engine-ae00187b58cc5ec20ceb2c00c912820c756ed275.tar.gz |
Merge pull request #77129 from dalexeev/gds-fix-static-var-bugs-part-1
GDScript: Fix some bugs with static variables and functions
Diffstat (limited to 'modules/gdscript/gdscript_disassembler.cpp')
-rw-r--r-- | modules/gdscript/gdscript_disassembler.cpp | 30 |
1 files changed, 30 insertions, 0 deletions
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<String> &p_code_lines) const { incr += 3; } break; + case OPCODE_SET_STATIC_VARIABLE: { + text += "set_static_variable script("; + Ref<GDScript> gdscript = get_constant(_code_ptr[ip + 2] & GDScriptFunction::ADDR_MASK); + text += gdscript.is_valid() ? gdscript->get_fully_qualified_name().get_file() : "<unknown script>"; + text += ")"; + if (gdscript.is_valid()) { + text += "[\"" + gdscript->debug_get_static_var_by_index(_code_ptr[ip + 3]) + "\"]"; + } else { + text += "[<index " + itos(_code_ptr[ip + 3]) + ">]"; + } + text += " = "; + text += DADDR(1); + + incr += 4; + } break; + case OPCODE_GET_STATIC_VARIABLE: { + text += "get_static_variable "; + text += DADDR(1); + text += " = script("; + Ref<GDScript> gdscript = get_constant(_code_ptr[ip + 2] & GDScriptFunction::ADDR_MASK); + text += gdscript.is_valid() ? gdscript->get_fully_qualified_name().get_file() : "<unknown script>"; + text += ")"; + if (gdscript.is_valid()) { + text += "[\"" + gdscript->debug_get_static_var_by_index(_code_ptr[ip + 3]) + "\"]"; + } else { + text += "[<index " + itos(_code_ptr[ip + 3]) + ">]"; + } + + incr += 4; + } break; case OPCODE_ASSIGN: { text += "assign "; text += DADDR(1); |