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) <noreply@anthropic.com>
This commit is contained in:
Axel Meyer
2026-06-01 22:04:05 +02:00
parent 89d68d7668
commit c5039e5bf2

View File

@@ -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