From 3eb4959e9a064fbd596a5aee49aad8755ac0505c Mon Sep 17 00:00:00 2001 From: jwinterm Date: Fri, 10 Jul 2026 22:44:26 -0400 Subject: [PATCH] fix(tavern): render the reliable procedural room, drop the goblin 'cat' MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - The imported .tmx tavern room renders as a block-scatter in the browser (the client falls back to the walkable grid, drawing furniture/walls as generic blocks). Gate it behind TAVERN_DESIGNED_ROOM=true and default to the hand-built procedural tavern (tavernMap.js) — bar + tables + walls — which renders reliably through the theme atlas. - Remove the tavern 'cat': it used the char-goblin sprite, so it read as a green monster stuck in the wall. Gone until there's a real critter sprite. --- html/js/render/tavernLife.js | 8 ++------ src/network/socketHandlers.js | 15 ++++++++++----- 2 files changed, 12 insertions(+), 11 deletions(-) diff --git a/html/js/render/tavernLife.js b/html/js/render/tavernLife.js index 54bd19f..dad2ea4 100644 --- a/html/js/render/tavernLife.js +++ b/html/js/render/tavernLife.js @@ -219,12 +219,8 @@ })); } - // Cat — a small wandering creature. - var catSpot = findFloor(3, rows - 3); - this.npcs.push(makeNPC('cat', 'cat', 'char-goblin', catSpot.x, catSpot.y, { - label: null, color: '#e8a060', role: 'cat', - roamArea: catArea(cols, rows) - })); + // (No "cat": it used the char-goblin sprite, which read as a green monster stuck in the + // wall. Left out until there's an actual pet/critter sprite.) }; TavernLife.prototype._pickTarget = function (npc, scene) { diff --git a/src/network/socketHandlers.js b/src/network/socketHandlers.js index ccc8332..b3f3f7f 100644 --- a/src/network/socketHandlers.js +++ b/src/network/socketHandlers.js @@ -198,11 +198,16 @@ class SocketHandlers { // Load the designed tavern room (imported .tmx); fall back to the procedural map if absent. let tavernRoomData = null; const tavernRoomUrl = 'assets/kenney/tavern_room.json'; - try { - const roomPath = require('path').join(__dirname, '../../html', tavernRoomUrl); - tavernRoomData = JSON.parse(require('fs').readFileSync(roomPath, 'utf8')); - } catch (e) { - if (this.debugManager.CONSOLE_LOGGING) console.log('Tavern room JSON not found; using default map:', e.message); + // The imported .tmx room renders as a block-scatter in the browser (the client falls back to + // the walkable grid), so use the hand-built procedural tavern (tavernMap.js) — which renders + // reliably through the theme atlas — by default. Opt back into the .tmx with TAVERN_DESIGNED_ROOM=true. + if (process.env.TAVERN_DESIGNED_ROOM === 'true') { + try { + const roomPath = require('path').join(__dirname, '../../html', tavernRoomUrl); + tavernRoomData = JSON.parse(require('fs').readFileSync(roomPath, 'utf8')); + } catch (e) { + if (this.debugManager.CONSOLE_LOGGING) console.log('Tavern room JSON not found; using default map:', e.message); + } } this.tavernManager = new TavernManager({ io: this.io,