schlosrat / token-health

FoundryVTT module
5 stars 10 forks source link

Healing not working (D&D 5e) #30

Closed GvosRamsey closed 3 years ago

GvosRamsey commented 3 years ago

When trying to apply healing to a token, I get this error.

Uncaught (in promise) TypeError: Cannot read property 'dying' of undefined

schlosrat commented 3 years ago

Thanks for calling this to my attention!

That is puzzling the module does look for a "dying" flag, but in each of the three places where it does so, it first checks to see if there is one or not and creates it if needed. Here's an example:

// Make sure we've got a flag for dying, get it if we do if (thisActor.getFlag("world", "dying") === undefined) { thisActor.setFlag("world", "dying", isDying); } else { isDying = thisActor.getFlag("world", "dying"); }

I'm wondering based on the error message if the problem is really that the "thisActor" object is somehow getting to be undefined? Does it happen to specify a line number? That might help me locate where things are going wrong.

schlosrat commented 3 years ago

I've tested this in the "Clash at the Kobold Cauldron" dnd5e world and confirmed that healing is working along with temporary hp and damage. If you can provide more information about ht e circumstances that can reliably reproduce this problem I'll be happy to take a look - but it does appear to be working as far as I can tell.

Is it possible you tried to use the module without a token selected?