Fix bestiary creatures with zero HP silently failing to add
All checks were successful
CI / check (push) Successful in 2m7s
CI / build-image (push) Successful in 23s

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) <noreply@anthropic.com>
This commit is contained in:
Lukas
2026-03-30 09:15:38 +02:00
parent 300d4b1f73
commit 228c1c667f

View File

@@ -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,
});