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) <noreply@anthropic.com>
This commit is contained in:
@@ -173,7 +173,7 @@ function addOneFromBestiary(
|
|||||||
|
|
||||||
const id = combatantId(`c-${nextId + 1}`);
|
const id = combatantId(`c-${nextId + 1}`);
|
||||||
const result = addCombatantUseCase(store, id, newName, {
|
const result = addCombatantUseCase(store, id, newName, {
|
||||||
maxHp: entry.hp,
|
maxHp: entry.hp > 0 ? entry.hp : undefined,
|
||||||
ac: entry.ac > 0 ? entry.ac : undefined,
|
ac: entry.ac > 0 ? entry.ac : undefined,
|
||||||
creatureId: cId,
|
creatureId: cId,
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user