mirror of
https://github.com/Foundryborne/daggerheart.git
synced 2026-04-23 07:53:39 +02:00
Simplify armor pip update
This commit is contained in:
parent
568c51a369
commit
68e1bec88b
1 changed files with 3 additions and 4 deletions
|
|
@ -1001,10 +1001,7 @@ export default class CharacterSheet extends DHBaseActorSheet {
|
||||||
decreasing = document.system.armor.current >= inputValue;
|
decreasing = document.system.armor.current >= inputValue;
|
||||||
newCurrent = decreasing ? inputValue - 1 : inputValue;
|
newCurrent = decreasing ? inputValue - 1 : inputValue;
|
||||||
await document.update({ 'system.armor.current': newCurrent });
|
await document.update({ 'system.armor.current': newCurrent });
|
||||||
} else {
|
} else if (document.system.armorData) {
|
||||||
const armorChange = document.system.armorChange;
|
|
||||||
if (!armorChange) return;
|
|
||||||
|
|
||||||
const { current } = document.system.armorData;
|
const { current } = document.system.armorData;
|
||||||
decreasing = current >= inputValue;
|
decreasing = current >= inputValue;
|
||||||
newCurrent = decreasing ? inputValue - 1 : inputValue;
|
newCurrent = decreasing ? inputValue - 1 : inputValue;
|
||||||
|
|
@ -1015,6 +1012,8 @@ export default class CharacterSheet extends DHBaseActorSheet {
|
||||||
}));
|
}));
|
||||||
|
|
||||||
await document.update({ 'system.changes': newChanges });
|
await document.update({ 'system.changes': newChanges });
|
||||||
|
} else {
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
const container = target.closest('.slot-bar');
|
const container = target.closest('.slot-bar');
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue