From e1b1208438b4e961915640e28766d73e8616cb62 Mon Sep 17 00:00:00 2001 From: kichikuou Date: Tue, 23 Sep 2025 08:12:44 +0900 Subject: [PATCH] PastelChime2.DungeonDataLoad: Initialize map after loading --- src/hll/PastelChime2.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/hll/PastelChime2.c b/src/hll/PastelChime2.c index f14d9b6..cce913e 100644 --- a/src/hll/PastelChime2.c +++ b/src/hll/PastelChime2.c @@ -447,9 +447,15 @@ static bool PastelChime2_DungeonDataLoad(int id, struct page **dungeon) if (index != dgn_nr_cells(ctx->dgn)) { VM_ERROR("expected %d cells, got %d", dgn_nr_cells(ctx->dgn), index); } - free(buf); free(path); + + dungeon_map_init(ctx); + struct dgn_cell *cells_end = ctx->dgn->cells + dgn_nr_cells(ctx->dgn); + for (struct dgn_cell *c = ctx->dgn->cells; c < cells_end; c++) { + if (c->walked) + dungeon_map_reveal(ctx, c->x, c->y, c->z, true); + } return true; }