From c5039e5bf2081d22ed76af3adbe7ba79b7636c40 Mon Sep 17 00:00:00 2001 From: Axel Meyer Date: Mon, 1 Jun 2026 22:04:05 +0200 Subject: [PATCH] fix(maps): set_cell_material invalidates _dirty + _opaque_ceiling Mirrors the cache-invalidation that set_vertex and set_cell_gid do. Without this, a cell-tile material write would update the storage but the opaque-ceiling cache could continue to report a stale state until something else invalidated it. Co-Authored-By: Claude Opus 4.7 (1M context) --- init.lua | 2 ++ 1 file changed, 2 insertions(+) diff --git a/init.lua b/init.lua index bccc5f7..0edec00 100644 --- a/init.lua +++ b/init.lua @@ -1600,6 +1600,8 @@ function M.set_cell_material(layer_name, cx, cy, painted, map_id) end local cm = ensure_cells_material(layer, w, h) cm[cy * w + cx + 1] = painted and 1 or 0 + m._dirty = true + m._opaque_ceiling = nil end -- 0.5.7: read the per-cell material flag. Returns false if