From ee4a293d3ef06b96859289abffc7c6db026eec72 Mon Sep 17 00:00:00 2001 From: Daan Vanden Bosch Date: Thu, 3 Oct 2019 00:18:11 +0200 Subject: [PATCH] Fixed some bugs. --- src/core/data_formats/parsing/quest/bin.ts | 3 +++ src/quest_editor/scripting/disassembly.test.ts | 2 ++ src/quest_editor/stores/quest_creation.ts | 2 ++ 3 files changed, 7 insertions(+) diff --git a/src/core/data_formats/parsing/quest/bin.ts b/src/core/data_formats/parsing/quest/bin.ts index 52cad4ce..25d4eca4 100644 --- a/src/core/data_formats/parsing/quest/bin.ts +++ b/src/core/data_formats/parsing/quest/bin.ts @@ -538,6 +538,7 @@ function parse_instructions_segment( type: SegmentType.Instructions, labels, instructions, + asm: { labels: [] }, }; offset_to_segment.set(cursor.position, segment); @@ -613,6 +614,7 @@ function parse_data_segment( type: SegmentType.Data, labels, data: cursor.array_buffer(end_offset - start_offset), + asm: { labels: [] }, }; offset_to_segment.set(start_offset, segment); } @@ -628,6 +630,7 @@ function parse_string_segment( type: SegmentType.String, labels, value: cursor.string_utf16(end_offset - start_offset, true, true), + asm: { labels: [] }, }; offset_to_segment.set(start_offset, segment); } diff --git a/src/quest_editor/scripting/disassembly.test.ts b/src/quest_editor/scripting/disassembly.test.ts index fa7167c9..d601235e 100644 --- a/src/quest_editor/scripting/disassembly.test.ts +++ b/src/quest_editor/scripting/disassembly.test.ts @@ -29,6 +29,7 @@ test("vararg instructions should be disassembled correctly", () => { ]), new_instruction(OP_RET, []), ], + asm: { labels: [] }, }, ]); @@ -56,6 +57,7 @@ test("va list instructions should be disassembled correctly", () => { new_instruction(OP_VA_END, []), new_instruction(OP_RET, []), ], + asm: { labels: [] }, }, ]; diff --git a/src/quest_editor/stores/quest_creation.ts b/src/quest_editor/stores/quest_creation.ts index 2db11bad..9cdc2632 100644 --- a/src/quest_editor/stores/quest_creation.ts +++ b/src/quest_editor/stores/quest_creation.ts @@ -50,6 +50,7 @@ export function create_new_quest(episode: Episode): QuestModel { ]), new_instruction(OP_RET, []), ], + asm: { labels: [] }, }, { labels: [150], @@ -85,6 +86,7 @@ export function create_new_quest(episode: Episode): QuestModel { new_instruction(OP_P_SETPOS, []), new_instruction(OP_RET, []), ], + asm: { labels: [] }, }, ], [],