From a2e1a4fd9a46b629423b283a25d88161eb2a6330 Mon Sep 17 00:00:00 2001 From: "Eevee (Evelyn Woods)" Date: Sat, 29 Aug 2020 01:31:05 -0600 Subject: [PATCH] Stop parsing a C2M at END; fix CC2 force floor tiles --- js/format-c2m.js | 4 ++++ js/tileset.js | 4 ++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/js/format-c2m.js b/js/format-c2m.js index f100717..8be44b9 100644 --- a/js/format-c2m.js +++ b/js/format-c2m.js @@ -205,6 +205,10 @@ export function parse_level(buf) { if (next_section_start > buf.byteLength) throw new Error(`Section at byte ${section_start} of type '${section_type}' extends ${buf.length - next_section_start} bytes past the end of the file`); + // This chunk marks the end of the file regardless + if (section_type === 'END ') + break; + if (section_type === 'CC2M' || section_type === 'LOCK' || section_type === 'VERS' || section_type === 'TITL' || section_type === 'AUTH' || section_type === 'CLUE' || section_type === 'NOTE') diff --git a/js/tileset.js b/js/tileset.js index 945ad02..2c4e44e 100644 --- a/js/tileset.js +++ b/js/tileset.js @@ -21,9 +21,9 @@ export const CC2_TILESET_LAYOUT = { ice_ne: [13, 1], ice_se: [11, 1], force_floor_n: [[0, 19], [0, 20]], - force_floor_e: [[2, 19], [2, 20]], + force_floor_e: [[2, 19], [3, 19]], force_floor_s: [[1, 19], [1, 20]], - force_floor_w: [[3, 19], [3, 20]], + force_floor_w: [[2, 20], [3, 20]], thief_keys: [15, 21], thief_tools: [3, 2],