🐛 fix Nisse stuck idle after stockpile deposit; rename Villager → Nisse in UI

This commit is contained in:
2026-03-20 17:07:34 +00:00
parent 8ed67313a8
commit 787ada7cb4
4 changed files with 24 additions and 11 deletions

View File

@@ -176,9 +176,9 @@ class StateManager {
if (!p.world.crops) p.world.crops = {}
if (!p.world.villagers) p.world.villagers = {}
if (!p.world.stockpile) p.world.stockpile = {}
// Reset walking villagers to idle on load
// Reset in-flight AI states to idle on load so runtime timers start fresh
for (const v of Object.values(p.world.villagers)) {
if (v.aiState === 'walking') v.aiState = 'idle'
if (v.aiState === 'walking' || v.aiState === 'working') v.aiState = 'idle'
}
return p
} catch (_) { return null }