Closed schlosrat closed 3 years ago
The speaker
and actor
variables already exist in both cases, with or without the module, but without the module, you can re-declare it because it uses eval
to evaluate the macro's script.
With Furnace, the macro gets called as a function, which allows it to be async (note: the same thing would happen in 0.8.x), so your macro would work if you don't use the const
before speaker
, as you would just overwrite the variable's value instead of trying to re-declare it.
In your case though, you wouldn't need to do ChatMessage.getSpeaker()
as Furnace already does it and the speaker
variable is already set to that (core Foundry does the same, so you should be able to access the speaker
variable in your macro with or without the module).
See https://github.com/League-of-Foundry-Developers/fvtt-module-furnace/blob/master/Macros/Macros.js#L151
I've got a macro I use (shown below) which works fine without this module loaded, but which generated syntax errors if I load this module.
Without The Furnace loaded it works as I'd expect, but with The Furnace loaded I get this in my game console