diff --git a/module.json b/module.json index f70f989..facd4ed 100644 --- a/module.json +++ b/module.json @@ -16,7 +16,7 @@ } ], "url": "https://github.com/Stendarpaval/mob-attack-tool", - "version": "0.3.5", + "version": "0.3.6", "minimumCoreVersion": "0.8.8", "compatibleCoreVersion": "0.8.8", "system": ["dnd5e"], @@ -27,5 +27,5 @@ "styles/mob-attack-tool.css" ], "manifest": "https://raw.githubusercontent.com/Stendarpaval/mob-attack-tool/main/module.json", - "download": "https://github.com/Stendarpaval/mob-attack-tool/releases/download/0.3.5/module.zip" + "download": "https://github.com/Stendarpaval/mob-attack-tool/releases/download/0.3.6/module.zip" } diff --git a/scripts/mobAttackTool.js b/scripts/mobAttackTool.js index 555d85b..cfdecc4 100644 --- a/scripts/mobAttackTool.js +++ b/scripts/mobAttackTool.js @@ -839,9 +839,9 @@ export function MobAttacks() { attacker = game.actors.get(locator["actorID"]); weapon = attacker.items.getName(locator["weaponName"]) weapons[weapon.id] = weapon; - attacks[weapon.id] = []; + attacks[locator.weaponID] = []; for (let target of targets) { - attacks[weapon.id].push({targetId: target.targetId, targetNumAttacks: target.weapons.filter(w => w.weaponId === locator.weaponID).length}); + attacks[locator.weaponID].push({targetId: target.targetId, targetNumAttacks: target.weapons.filter(w => w.weaponId === weapon.id).length}); } }) @@ -857,7 +857,12 @@ export function MobAttacks() { })(); } + async function createDialog() { + await mobAttackTool(); + } + return { - quickRoll:quickRoll + quickRoll:quickRoll, + createDialog:createDialog }; } \ No newline at end of file