ZotyDev / objects-interactions-fx

A Foundry VTT module that provides automation and effects for everything that I and other people might find fun :D
https://foundryvtt.com/packages/object-interaction-fx
MIT License
11 stars 2 forks source link

Can't open NPC Sheet after throwing dagger #6

Closed ravingdragoon closed 1 year ago

ravingdragoon commented 1 year ago

I not able to open the Tidy5e NPC Sheet after attacking with a ranged weapon and having it remove from the NPCs character sheet. I get the error below when attempting to open the character sheet that the item came from, but have no issue opening and seeing the character sheet and item of the NPC that was attacked.

Error: An error occurred while rendering Tidy5eNPC 319. One of original or other are not Objects!
[Detected 2 packages: item-piles, lib-wrapper]
    at mergeObject (commons.js:2359:13)
    at _mergeUpdate (commons.js:2423:14)
    at mergeObject (commons.js:2380:41)
    at _mergeUpdate (commons.js:2423:14)
    at mergeObject (commons.js:2380:41)
    at _mergeUpdate (commons.js:2423:14)
    at Object.mergeObject (commons.js:2380:41)
    at Tidy5eNPC._render (foundry.js:5104:19)
    at Tidy5eNPC._render (foundry.js:5822:17)
    at Tidy5eNPC.render (foundry.js:5067:10)
    at Tidy5eNPC.render (foundry.js:6394:18)
    at Token5e._onClickLeft2 (foundry.js:47378:16)
    at 🎁call_wrapped [as call_wrapped] (libWrapper-wrapper.js:507:22)
    at 🎁Token.prototype._onClickLeft2#item-piles (libwrapper.js:13:12)
    at 🎁Token.prototype._onClickLeft2#0 (libWrapper-wrapper.js:187:52)
    at MouseInteractionManager.callback (foundry.js:27813:45)
    at MouseInteractionManager._handleClickLeft2 (foundry.js:28027:17)
    at MouseInteractionManager._handleMouseDown (foundry.js:27989:66)
    at a.emit (index.js:181:35)
    at r.dispatchEvent (interaction.min.mjs:8:12235)
    at r.processPointerDown (interaction.min.mjs:8:14214)
    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.onPointerDown (interaction.min.mjs:8:13543)
onError @ foundry.js:747
🎁call_wrapped @ libWrapper-wrapper.js:507
🎁Hooks.onError#lib-wrapper @ listeners.js:138
🎁Hooks.onError#0 @ libWrapper-wrapper.js:187
(anonymous) @ foundry.js:5069
Promise.then (async)
render @ foundry.js:5067
render @ foundry.js:6394
_onClickLeft2 @ foundry.js:47378
🎁call_wrapped @ libWrapper-wrapper.js:507
🎁Token.prototype._onClickLeft2#item-piles @ libwrapper.js:13
🎁Token.prototype._onClickLeft2#0 @ libWrapper-wrapper.js:187
callback @ foundry.js:27813
_handleClickLeft2 @ foundry.js:28027
_handleMouseDown @ foundry.js:27989
a.emit @ index.js:181
r.dispatchEvent @ interaction.min.mjs:8
r.processPointerDown @ 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.onPointerDown @ interaction.min.mjs:8
ZotyDev commented 1 year ago

Can you open the sheet using the default dnd5e template? Try to disable Tidy5e sheet. Are you attacking with a ranged weapon, or a melee weapon that got it's attack transformed into thrown? I will try to replicate, can you send the list with name and version of the enabled modules? Also, thanks for reporting bugs, always appreciated 👍

ZotyDev commented 1 year ago

This one might be a little bit hard to find.. Could you post here all the configs for the item (quantity, system specific, etc) alongside the used tag?

ZotyDev commented 1 year ago

One last thing, can you check if the error happens on a fresh world?

ravingdragoon commented 1 year ago

I am using Google Chrome. I am using a single dagger with the tag "dagger" (no actual quotes) which I guess would be a melee weapon transformed to thrown. The error does not occur with the default NPC sheet. On a fresh world it still happens, however the error message is different. A difference that I notice when using the tidy5e sheet is that the dagger does not show get automatically removed from the sheet, it still shows as an equipped item until I close the sheet (at which point I cannot open it again).

TypeError: An error occurred while rendering Tidy5eNPC 52. Cannot read properties of undefined (reading 'getChatData')
[Detected 4 packages: system:dnd5e, tidy5e-sheet, item-piles, lib-wrapper]
    at Tidy5eNPC.getData (base-sheet.mjs:166:64)
    at Tidy5eNPC.getData (npc-sheet.mjs:27:33)
    at Tidy5eNPC.getData (tidy5e-npc.js:193:31)
    at Tidy5eNPC._render (foundry.js:5108:29)
    at Tidy5eNPC._render (foundry.js:5822:17)
    at Tidy5eNPC.render (foundry.js:5067:10)
    at Tidy5eNPC.render (foundry.js:6394:18)
    at Token5e._onClickLeft2 (foundry.js:47378:16)
    at 🎁call_wrapped [as call_wrapped] (libWrapper-wrapper.js:507:22)
    at 🎁Token.prototype._onClickLeft2#item-piles (libwrapper.js:13:12)
    at 🎁call_wrapper [as call_wrapper] (libWrapper-wrapper.js:616:16)
    at 🎁Token.prototype._onClickLeft2#0 (libWrapper-wrapper.js:189:20)
    at MouseInteractionManager.callback (foundry.js:27813:45)
    at MouseInteractionManager._handleClickLeft2 (foundry.js:28027:17)
    at MouseInteractionManager._handleMouseDown (foundry.js:27989:66)
    at a.emit (index.js:181:35)
    at r.dispatchEvent (interaction.min.mjs:8:12235)
    at r.processPointerDown (interaction.min.mjs:8:14214)
    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.onPointerDown (interaction.min.mjs:8:13543)
onError @ foundry.js:747
🎁call_wrapped @ libWrapper-wrapper.js:507
🎁Hooks.onError#lib-wrapper @ listeners.js:138
🎁Hooks.onError#0 @ libWrapper-wrapper.js:187
(anonymous) @ foundry.js:5069
Promise.catch (async)
render @ foundry.js:5067
render @ foundry.js:6394
_onClickLeft2 @ foundry.js:47378
🎁call_wrapped @ libWrapper-wrapper.js:507
🎁Token.prototype._onClickLeft2#item-piles @ libwrapper.js:13
🎁call_wrapper @ libWrapper-wrapper.js:616
🎁Token.prototype._onClickLeft2#0 @ libWrapper-wrapper.js:189
callback @ foundry.js:27813
_handleClickLeft2 @ foundry.js:28027
_handleMouseDown @ foundry.js:27989
a.emit @ index.js:181
r.dispatchEvent @ interaction.min.mjs:8
r.processPointerDown @ 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.onPointerDown @ interaction.min.mjs:8
ravingdragoon commented 1 year ago

I tested this with a light crossbow and crossbow bolt and the error does not occur. After this test I am no longer getting the error with the dagger on either world, and am unable to recreate the issue.

ZotyDev commented 1 year ago

I could not replicate it either, tried everything, sometimes foundry confuses me lol. Will leave this issue open for now, maybe someone encounters the same error.