Update for v9 compatibility.

This commit is contained in:
fyorl 2021-12-10 13:39:58 +00:00
parent fb0add4cbc
commit e966775723
No known key found for this signature in database
GPG key ID: 3A4E57DAE36AC3C4
4 changed files with 22 additions and 20 deletions

View file

@ -8,7 +8,7 @@
export async function createWorldbuildingMacro(data, slot) {
const command = `const roll = new Roll("${data.roll}", actor ? actor.getRollData() : {});
roll.toMessage({speaker, flavor: "${data.label}"});`;
let macro = game.macros.entities.find(m => (m.name === item.label) && (m.command === command));
let macro = game.macros.find(m => (m.name === item.label) && (m.command === command));
if (!macro) {
macro = await Macro.create({
name: data.label,