mclemente/healthEstimate

[BUG] Incompatibility with Combat Utility Belt since HealthEstimate 3.9.1 in Splittermond system

Closed this issue · 4 comments

Describe the bug
Incompatibility with Combat Utility Belt since HealthEstimate 3.9.1.

To Reproduce
Steps to reproduce the behavior:

  1. Enable only the HealthEstimate and Combat Utility Belt modules. Both in it's latest version
  2. Damage any token and see no estimate
  3. Disable CUB and you can see the estimate
  4. Reenable CUB and downgrade Health Estimate to 3.9.0 and you can see the estimate, too

Expected behavior
The behaviour should not change when upgrading to version 3.9.1.

Game Specifics (please complete the following information):

  • Game system and version: Splittermond 0.9.8
  • Foundry version: 10.303
  • HealthEstimate version: 3.9.0 and 3.9.1
  • CUB version: v1.10.4

Additonal information
I did test this while having all other modules disabled, so I am pretty sure it's only between these two modules.

Any errors on the console? I couldn't reproduce this on a brand new world.

@mclemente

Health Estimate | Error on getEstimation(). Token Name: "Morgana". Type: "character". TypeError: Cannot read properties of undefined (reading 'icon')
    at HealthEstimate.tokenEffectsPath (logic.js:316:55)
    at HealthEstimate.isDead (logic.js:296:44)
    at HealthEstimate.getEstimation (logic.js:156:24)
    at HealthEstimate._handleOverlay (logic.js:84:42)
    at Object.fn (logic.js:55:9)
    at #call (foundry.js:724:20)
    at Hooks.callAll (foundry.js:681:17)
    at Token.refresh (foundry.js:25284:11)
    at Token._onHoverIn (foundry.js:25564:10)
    at Token._onHoverIn (foundry.js:47404:18)
    at MouseInteractionManager.callback (foundry.js:27872:45)
    at MouseInteractionManager._handleMouseOver (foundry.js:27989:17)
    at a.emit (index.js:181:35)
    at r.dispatchEvent (interaction.min.mjs:8:12235)
    at r.processPointerMove (interaction.min.mjs:8:17255)
    at t.recursiveFindHit (interaction.min.mjs:8:4098)
    at t.recursiveFindHit (interaction.min.mjs:8:3882)
    at t.recursiveFindHit (interaction.min.mjs:8:3882)
    at t.recursiveFindHit (interaction.min.mjs:8:3882)
    at t.recursiveFindHit (interaction.min.mjs:8:3882)
    at t.recursiveFindHit (interaction.min.mjs:8:3882)
    at t.findHit (interaction.min.mjs:8:4157)
    at r.processInteractive (interaction.min.mjs:8:12841)
    at r.onPointerMove (interaction.min.mjs:8:16687)
getEstimation @ logic.js:167
_handleOverlay @ logic.js:84
(anonymous) @ logic.js:55
#call @ foundry.js:724
callAll @ foundry.js:681
refresh @ foundry.js:25284
_onHoverIn @ foundry.js:25564
_onHoverIn @ foundry.js:47404
callback @ foundry.js:27872
_handleMouseOver @ foundry.js:27989
a.emit @ index.js:181
r.dispatchEvent @ interaction.min.mjs:8
r.processPointerMove @ interaction.min.mjs:8
t.recursiveFindHit @ interaction.min.mjs:8
t.recursiveFindHit @ interaction.min.mjs:8
t.recursiveFindHit @ interaction.min.mjs:8
t.recursiveFindHit @ interaction.min.mjs:8
t.recursiveFindHit @ interaction.min.mjs:8
t.recursiveFindHit @ interaction.min.mjs:8
t.findHit @ interaction.min.mjs:8
r.processInteractive @ interaction.min.mjs:8
r.onPointerMove @ interaction.min.mjs:8

I couldn't reproduce it either with a brand new world and I can't find the right settings to break it.

But I think game.healthEstimate.estimationProvider.deathMarker.config isn't set for splittermond in module/logic.js, so it doesn't use game.healthEstimate.deathMarker as the deathMarker as it used to and tries CONFIG.statusEffects.find((x) => x.id === "dead").icon; which fails.

When I revert this change, it works again:

-               return Array.from(token.actor.effects.values()).some((x) => x.icon === game.healthEstimate.deathMarker);
+               const deadIcon = game.healthEstimate.estimationProvider.deathMarker.config
+                       ? game.healthEstimate.deathMarker
+                       : CONFIG.statusEffects.find((x) => x.id === "dead").icon;
+               return Array.from(token.actor.effects.values()).some((x) => x.icon === deadIcon);

I believe it has something to do with me changing a lot in the conditions lab of CUB, which might have broken something with the death marker irreversibly... since even the defaults don't seem to work anymore.

Ah, you deleted/replaced the status effect that has the "dead" id, and since the setting is set before CUB replaces it, the setting isn't shown. I'll make a fix for it.

The whole icon thing is 100% a bug too.