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 Jun 12, 2021
2 parents 343e430 + 58da6a6 commit ab4f043
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 3 deletions.
4 changes: 4 additions & 0 deletions changelog.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Changelog

## [1.0.34] 2021-06-12
### Bugfix
- DND5e - fingers crossed now supports 0.7 and 0.8.

## [1.0.33] 2021-06-11
### Changed
- Set minimum compatible core version to 0.8.0 for the moment, hopefully only temporary while I work shit out
Expand Down
5 changes: 3 additions & 2 deletions scripts/actions/dnd5e/dnd5e-actions.js
Original file line number Diff line number Diff line change
Expand Up @@ -727,10 +727,11 @@ export class ActionHandler5e extends ActionHandler {
/** @private */
_buildItem(tokenId, actor, macroType, item) {
const itemData = this._getEntityData(item);
let encodedValue = [macroType, tokenId, item.id].join(this.delimiter);
const itemId = item.id ?? item._id;
let encodedValue = [macroType, tokenId, itemId].join(this.delimiter);
let img = this._getImage(item);
let icon = this._getActionIcon(item.data?.activation?.type);
let result = { name: item.name, id: item.id, encodedValue: encodedValue, img: img, icon: icon }
let result = { name: item.name, id: itemId, encodedValue: encodedValue, img: img, icon: icon }

if (itemData.recharge && !itemData.recharge.charged && itemData.recharge.value) {
result.name += ` (${this.i18n('tokenactionhud.recharge')})`;
Expand Down
7 changes: 6 additions & 1 deletion scripts/rollHandlers/dnd5e/dnd5e-base.js
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,8 @@ export class RollHandlerBase5e extends RollHandler {
}

needsRecharge(item) {
return (item.data.data.recharge && !item.data.data.recharge.charged && item.data.data.recharge.value);
const itemData = this._getEntityData(item);
return (itemData.recharge && !itemData.recharge.charged && itemData.recharge.value);
}

async performUtilityMacro(event, tokenId, actionId) {
Expand Down Expand Up @@ -186,4 +187,8 @@ export class RollHandlerBase5e extends RollHandler {
}


_getEntityData(entity) {
return entity.data.data ?? entity.data;
}

}

0 comments on commit ab4f043

Please sign in to comment.