Skip to content

Commit

Permalink
Finally fix attackrolls issue (#48)
Browse files Browse the repository at this point in the history
- Initialize correctly the `ac5eConfig` object for the `_preRollAttack()`
  • Loading branch information
thatlonelybugbear authored Mar 16, 2024
1 parent 6dc0171 commit 3a45ede
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 8 deletions.
4 changes: 2 additions & 2 deletions module.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"id": "automated-conditions-5e",
"title": "Automated Conditions 5e",
"description": "A small module for Foundry VTT that tries to automate some rolling aspects of the common 5e Conditions.",
"version": "11.315.304.6",
"version": "11.315.304.6.1",
"authors": [
{
"name": "thatlonelybugbear",
Expand Down Expand Up @@ -47,6 +47,6 @@
"url": "https://github.com/thatlonelybugbear/automated-conditions-5e",
"license": "https://raw.githubusercontent.com/thatlonelybugbear/automated-conditions-5e/main/LICENSE",
"manifest": "https://github.com/thatlonelybugbear/automated-conditions-5e/releases/latest/download/module.json",
"download": "https://github.com/thatlonelybugbear/automated-conditions-5e/releases/download/v11.315.304.6/module.zip",
"download": "https://github.com/thatlonelybugbear/automated-conditions-5e/releases/download/v11.315.304.6.1/module.zip",
"changelog": "https://raw.githubusercontent.com/thatlonelybugbear/automated-conditions-5e/main/Changelog.md"
}
8 changes: 2 additions & 6 deletions scripts/ac5e-hooks.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -152,12 +152,8 @@ export function _preRollAttack(item, config) {
if (config.event?.altKey || config.event?.ctrlKey) return true;
let change = false;
const ac5eConfig = getConfig(config);
ac5eConfig.advantage = ac5eConfig.advantage
? { source: ['default'] }
: { source: [] };
ac5eConfig.disadvantage = ac5eConfig.disadvantage
? { source: ['default'] }
: { source: [] };
ac5eConfig.advantage = { source: ac5eConfig.advantage };
ac5eConfig.disadvantage = { source: ac5eConfig.disadvantage };
ac5eConfig.advantage.target = [];
ac5eConfig.disadvantage.target = [];
const sourceToken = canvas.tokens.get(sourceTokenID); //Token5e
Expand Down

0 comments on commit 3a45ede

Please sign in to comment.