Skip to content

Damage threshold incorrectly applied to healing #6513

Description

@Aioros

Steps to reproduce:

  1. create new actor;
  2. set their HP using the HitPointsConfig dialog;
  3. try to apply healing damage.

Seems like the issue is undesired precedence in this condition:

damages.amount < (this.system.attributes?.hp?.dt) ?? -Infinity

where the < is evaluated before the coalescing. When setting the HP on the actor, dt becomes null (instead of the original undefined), and funnily enough -1 < undefined === false but -1 < null === true. In any case, just fixing the parenthesis should fix it. I'll make a quick PR in a few.

Metadata

Metadata

Assignees

Labels

Type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions