DramaticShapeVoxelMod archival mirror · read-only
c6811674755d3c309d7396cefd11a34d42048055

add doors to s/w/e sides of gate houses

DramaticShape · 2026-08-08 · parent 99de8c2760

add doors to s/w/e sides of gate houses

Changed files

lib/Buildings.lua | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

Diff

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