Skip to content
This repository has been archived by the owner on Jul 10, 2021. It is now read-only.

Commit

Permalink
Merge branch 'develop'
Browse files Browse the repository at this point in the history
  • Loading branch information
espositos committed Jul 3, 2021
2 parents 8c2f8c8 + ab868fb commit edafeec
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 10 deletions.
5 changes: 5 additions & 0 deletions changelog.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
# Changelog

## [1.1.6] 2021-07-03
### Bugfix
- Pf2E Fix expending and regaining spell slots in pf2e thanks to Drental
- SWADE BR2 Update swade-br2sw from zk-sn

## [1.1.5] 2021-06-26
### Bugfix
- DND5e fixes for a variety of issues thanks to benbarbour
Expand Down
6 changes: 3 additions & 3 deletions scripts/rollHandlers/pf2e/pf2e-base.js
Original file line number Diff line number Diff line change
Expand Up @@ -231,9 +231,9 @@ export class RollHandlerBasePf2e extends RollHandler {

let update;
if (slot === 'focus')
update = [{id: spellbook.id, data: { focus: {points: value}}}];
update = [{_id: spellbook.id, data: { focus: {points: value}}}];
else
update = [{id: spellbook.id, data: {slots: {[slot]: {value: value}}}}];
update = [{_id: spellbook.id, data: { slots: {[slot]: {value: value}}}}];

await Item.updateDocuments(update, {parent: actor});
Hooks.callAll('forceUpdateTokenActionHUD');
Expand Down Expand Up @@ -408,7 +408,7 @@ export class RollHandlerBasePf2e extends RollHandler {

const key = `data.slots.slot${level}.prepared.${spellSlot}`;
const options = {
id: spellbookId,
_id: spellbookId,
};
options[key] = {
expended: true,
Expand Down
17 changes: 10 additions & 7 deletions scripts/rollHandlers/swade/swade-br2sw.js
Original file line number Diff line number Diff line change
Expand Up @@ -84,13 +84,16 @@ export class RollHandlerBR2SWSwade extends RollHandler {
update.data.status[status] = !actor.data.data.status[status];

await actor.update(update);

const effect = CONFIG.SWADE.statusEffects.find(e=>e.id===actionId);
const existingOnToken = actor.effects.find(e => e.getFlag("core", "statusId") === actionId);

if (!existingOnToken == !existingOnSheet) {
canvas.tokens.get(tokenId).toggleEffect(effect);
}
// SWADE system will eventually set the active effect on the token, this future-proofs it so duplicate effects don't occur
setTimeout(() => {
const existingOnToken = actor.effects.find(e => e.getFlag("core", "statusId") === actionId);

if (!existingOnToken == !existingOnSheet) {
const effect = CONFIG.SWADE.statusEffects.find(e=>e.id===actionId);
effect["flags.core.statusId"] = actionId;
canvas.tokens.get(tokenId).toggleEffect(effect);
}
}, 10);
}

/** @private */
Expand Down

0 comments on commit edafeec

Please sign in to comment.