feat: wire backstory generation into NPC spawn flow

Trigger fire-and-forget backstory generation whenever an NPC spawns,
both during initial spawn and via player spawn-npc requests.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
root
2026-03-08 16:52:13 +00:00
parent aa3f5651dd
commit 8c793578ae
2 changed files with 9 additions and 2 deletions
+2 -1
View File
@@ -70,7 +70,8 @@ export class SocketServer {
const target = map.findNearestWalkable(data.x, data.y, 3)
?? map.getRandomWalkable();
spawnNPC(world, map, target);
const npcEntity = spawnNPC(world, map, target);
this.gameLoop.generateNpcBackstory(npcEntity);
});
// Handle superlatives subscription