Fix demo game fog layer accumulation and web IDBFS mkdir race

- Add stairs position to occupied set to prevent enemy/item overlap
- Remove old fog layer before creating new one on level transitions
- Reset fog_layer reference on new game to avoid stale grid reference
- Wrap FS.mkdir('/save') in try/catch for page reload resilience

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
John McCardle 2026-04-10 02:19:19 -04:00
commit 7d1066a5d5
2 changed files with 6 additions and 2 deletions

View file

@ -362,7 +362,7 @@
var Module = {
preRun: [function() {
FS.mkdir('/save');
try { FS.mkdir('/save'); } catch(e) { /* already exists */ }
FS.mount(IDBFS, {}, '/save');
Module.addRunDependency('idbfs-restore');
FS.syncfs(true, function(err) {