mirror of
https://github.com/Foundryborne/daggerheart.git
synced 2026-06-06 04:44:16 +02:00
Fixed a data path error in character._preUpdate when scars are changed by an update (#1856)
This commit is contained in:
parent
94e93222a4
commit
516928f92b
1 changed files with 4 additions and 4 deletions
|
|
@ -836,10 +836,10 @@ export default class DhCharacter extends DhCreature {
|
|||
|
||||
/* Scars can alter the amount of current hope */
|
||||
if (changes.system?.scars) {
|
||||
const diff = this.system.scars - changes.system.scars;
|
||||
const newHopeMax = this.system.resources.hope.max + diff;
|
||||
const newHopeValue = Math.min(newHopeMax, this.system.resources.hope.value);
|
||||
if (newHopeValue != this.system.resources.hope.value) {
|
||||
const diff = this.scars - changes.system.scars;
|
||||
const newHopeMax = this.resources.hope.max + diff;
|
||||
const newHopeValue = Math.min(newHopeMax, this.resources.hope.value);
|
||||
if (newHopeValue != this.resources.hope.value) {
|
||||
if (!changes.system.resources.hope) changes.system.resources.hope = { value: 0 };
|
||||
|
||||
changes.system.resources.hope = {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue