mirror of
https://github.com/cliffe/BreakEscape.git
synced 2026-02-22 11:48:18 +00:00
Fixed a timing issue where NPC-table collisions weren't being created because table physics bodies were initialized asynchronously (delayedCall) while NPC collision setup ran immediately. Changes: 1. Added 10ms delay to NPC environment collision setup to ensure table/chair physics bodies are fully initialized first (rooms.js:2678) 2. Improved table detection logic in setupNPCTableCollisions (npc-sprites.js): - Removed dependency on obj.body.static flag which may not be set yet - Now checks scenarioData.type === 'table' first (most reliable) - Also checks for 'desk' or 'table' in object name as fallback - Added detailed logging for each table collision created This ensures NPCs cannot walk through tables and maintains proper collision detection throughout the game.