Open kiloforce opened 4 months ago
The Javascript console is pretty quiet and unhelpful in trying determine the cause here:
same problem Dnd5e system 3.3.1 Foundry v12.330 Health Monitor Module v3.1.0
Looks like the code should already handle this "zero" situation:
// If delta is null or 0, return
if (!v) continue;
Which means whatever is coming across is not actually a zero. Likely whatever the actual value that is coming across is something that is just resolving down to zero in the math abs() function:
[Math.abs(v)](delta: Math.abs(v),)
In which case, could do something like:
// If delta is null or 0, return
if (!v || Math.abs(v) == 0) continue;
Nope, did some testing. This is not where the problem is. Turns out there is a second section that also captures deltas, that wasn't checking for zeros. Still not sure why this wasn't a problem until v12. Just simply added this same zero check there, and seemed to solve the problem.
main.js:
// For each HP delta, create a chat message.
for (const [k, delta] of Object.entries(deltas)) {
// If delta is null or 0, return
if (!delta) continue;
I don't know when the original author will pull in these pull requests, so in the meantime, if you want to try out the fixes, you can load a preview build here:
Install Module - Manifest URL - https://github.com/kiloforce/health-monitor/releases/latest/download/module.json
When either DM or player closes any character sheet, the Health Monitor reports to chat "[NAME] takes 0 damage".
Foundry v12.330 Health Monitor Module v3.1.0