klaas1979 / tablesmith-like

Use Tablesmith-like tables in FoundryVTT and create complex nested tables.
MIT License
3 stars 5 forks source link

Failure to roll from a standard Foundry table from within a macro #10

Closed IrmatDen closed 2 years ago

IrmatDen commented 2 years ago

Hello,

I was about to test Tablesmith Like Tables, but ran into an issue. It appears I can't draw from standard Foundry rolltables from within a macro. The macro was created after dropping the rolltable on the action bar at the bottom and is the following: game.tables.get("2UAGLrX1o1Os9tSs").draw();

Disabling the Tablesmith Like Tables modules allows the macro to run as expected: a result is drawn from the table and written to the chat. Re-enabling the module fails to draw.

Here is the callstack from the console.

rolltable-wrapper.ts:30 Uncaught (in promise) TypeError: Cannot read properties of undefined (reading 'displayChat')
[Detected 3 packages: tablesmith-like, lib-wrapper, advanced-macros]
    at RollTable.rollTableDrawWrapper (rolltable-wrapper.ts:30)
    at Wrapper.🎁call_wrapper [as call_wrapper] (libWrapper-wrapper.js:620)
    at RollTable.🎁RollTable.prototype.draw#0 (libWrapper-wrapper.js:189)
    at eval (eval at callScriptMacroFunction (Macros.js:172), <anonymous>:4:40)
    at Macro.eval (eval at callScriptMacroFunction (Macros.js:172), <anonymous>:5:5)
    at Macro.callScriptMacroFunction [as callScriptFunction] (Macros.js:173)
    at Macro.renderMacro [as renderContent] (Macros.js:189)
    at Macro.executeMacro (Macros.js:210)
    at MacroConfig._onExecute (foundry.js:49881)

Please let me know if you need any other info.

Edit: sorry, I forgot to add versions:

klaas1979 commented 2 years ago

Could you provide the table maybe shortened to a single entry?

IrmatDen commented 2 years ago

Here's a test table and the autogenerated macro. It happened with 5 different tables; I didn't think you'd have trouble reproducing it.

macros.db.txt tables.db.txt

klaas1979 commented 2 years ago

Latest Release should fix the issue, please report if it does not work

IrmatDen commented 2 years ago

Works perfectly, thanks, that was fast! :)