From 228c1c667f9fae126dfe3de40872b1176a44dddb Mon Sep 17 00:00:00 2001 From: Lukas Date: Mon, 30 Mar 2026 09:15:38 +0200 Subject: [PATCH] Fix bestiary creatures with zero HP silently failing to add Bestiary sources like AWM store 0 for unknown HP. Passing maxHp: 0 into addCombatant triggered domain validation rejection, silently dropping the creature. Treat hp: 0 as undefined, matching existing ac: 0 handling. Co-Authored-By: Claude Opus 4.6 (1M context) --- apps/web/src/hooks/use-encounter.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/web/src/hooks/use-encounter.ts b/apps/web/src/hooks/use-encounter.ts index 34602ef..b64636b 100644 --- a/apps/web/src/hooks/use-encounter.ts +++ b/apps/web/src/hooks/use-encounter.ts @@ -173,7 +173,7 @@ function addOneFromBestiary( const id = combatantId(`c-${nextId + 1}`); const result = addCombatantUseCase(store, id, newName, { - maxHp: entry.hp, + maxHp: entry.hp > 0 ? entry.hp : undefined, ac: entry.ac > 0 ? entry.ac : undefined, creatureId: cId, });