From c6811674755d3c309d7396cefd11a34d42048055 Mon Sep 17 00:00:00 2001 From: DramaticShape Date: Sat, 8 Aug 2026 19:57:22 -0400 Subject: [PATCH] add doors to s/w/e sides of gate houses --- lib/Buildings.lua | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/lib/Buildings.lua b/lib/Buildings.lua index 46f89a8..d90971f 100644 --- a/lib/Buildings.lua +++ b/lib/Buildings.lua @@ -1633,7 +1633,13 @@ end -- The south face is skipped whether or not it is drawn: it is the one face -- the drawing states in full, so anything it needs it already has. local function sideDoorsAt(map, tileset, tx, ty, bw, bh) - local defs = _G.Game and Game.data and Game.data.maps + -- through the module, NOT a global: `Game` is a local everywhere in the + -- engine (`local Game = require("src.core.Game")` in a dozen files) and + -- reading `_G.Game` came back nil every time -- which fails silently and + -- exactly like the feature being off, because a nil map table is also + -- what a headless build legitimately has. + local ok, G = pcall(require, "src.core.Game") + local defs = ok and G and G.data and G.data.maps local warps = map.def and map.def.warps if not (defs and warps and warps[1]) then return nil end if not Buildings.sideDoorCell(tileset.id) then return nil end