Kekilla0 / Item-Macro

Store macros in your items, execute them from your character sheet or from your favorite automation module!
MIT License
18 stars 21 forks source link

ItemMacro not getting arguments from parent #60

Closed TogaParty closed 1 year ago

TogaParty commented 1 year ago

When executing an ItemMacro, it's not receiving any arguments from the parent item in v10. I have an onuse macro = "ItemMacro", but when I log out parameters (console.log(args)), the length is zero. This prevents any of the item macros from working correctly for me. Maybe it's a configuration issue? It seems to work fine in v9.

Below is one of the possible errors that can result, but this could cause any number of issues. If you try with the compendium version of Hunter's Mark SRD (Hunter's Mark - MQ0.8.20), you get a slightly different error against "hitTargets".

Uncaught (in promise) TypeError: undefined. Cannot read properties of undefined (reading 'tag') [Detected 1 package: itemacro] at eval (eval at Item._executeScript (helper.js:82:18), :8:12) at Macro.eval (eval at Item._executeScript (helper.js:82:18), :11:9) at Item._executeScript (helper.js:88:12) at Item.executeMacro (helper.js:60:23) at HTMLDivElement. (helper.js:170:20) at HTMLDivElement.dispatch (jquery.min.js:2:43064) at y.handle (jquery.min.js:2:41048)

trioderegion commented 1 year ago

Midi should be forwarding these arguments into the scope of the Item Macro function. I do not believe this is an issue with Item Macro as it is only being used as a storage location and the execution is not handled by Item Macro at all.