diff --git a/changelog.md b/changelog.md index ac12e824..2a65271e 100644 --- a/changelog.md +++ b/changelog.md @@ -1,5 +1,9 @@ # Item Piles Changelog +## Version 1.2.4 Hotfix +- Fixed error in `ItemPiles.API.addItems` throwing errors +- Fixed D&D 3.5e system not correctly implemented + ## Version 1.2.3 - Added API method: - `ItemPiles.API.openItemPileInventory` - forces a given set of users to open an item pile's inventory UI diff --git a/docs/api.md b/docs/api.md index 004dca3f..550e50a4 100644 --- a/docs/api.md +++ b/docs/api.md @@ -57,10 +57,10 @@ ItemPiles.API.revertTokensFromItemPiles(selectedTokens);
Promise
Creates the default item pile token at a location.
Promise.<Array>
Promise.<Array>
Turns tokens and its actors into item piles
Promise.<Array>
Promise.<Array>
Reverts tokens from an item pile into a normal token and actor
Promise
Promise.<Array>
+## turnTokensIntoItemPiles(targets, { pileSettings, tokenSettings }) ⇒ Promise.<Array>
Turns tokens and its actors into item piles
**Returns**: Promise.<Array>
- The uuids of the targets after they were turned into item piles
@@ -279,7 +279,7 @@ Turns tokens and its actors into item piles
---
-## revertTokensFromItemPiles(targets, tokenSettings) ⇒ Promise.<Array>
+## revertTokensFromItemPiles(targets, { tokenSettings }) ⇒ Promise.<Array>
Reverts tokens from an item pile into a normal token and actor
**Returns**: Promise.<Array>
- The uuids of the targets after they were reverted from being item piles
diff --git a/scripts/api.js b/scripts/api.js
index f256d46b..1a62a971 100644
--- a/scripts/api.js
+++ b/scripts/api.js
@@ -224,7 +224,8 @@ export default class API {
"scale": lib.getItemPileTokenScale(target, pileSettings),
});
- const [_, sceneId, __, tokenId] = targetUuid.split('.');
+ const sceneId = targetUuid.split('.')[1];
+ const tokenId = targetUuid.split('.')[3];
if (!tokenUpdateGroups[sceneId]) {
tokenUpdateGroups[sceneId] = []
@@ -293,7 +294,8 @@ export default class API {
const pileSettings = foundry.utils.mergeObject(defaults, lib.getItemPileData(target));
pileSettings.enabled = false;
- const [_, sceneId, __, tokenId] = targetUuid.split('.');
+ const sceneId = targetUuid.split('.')[1];
+ const tokenId = targetUuid.split('.')[3];
if (!tokenUpdateGroups[sceneId]) {
tokenUpdateGroups[sceneId] = [];
@@ -865,7 +867,7 @@ export default class API {
}
return {
item: item,
- quantity: itemData?.quantity ?? getProperty(foundActorItem.data, API.ITEM_QUANTITY_ATTRIBUTE)
+ quantity: itemData?.quantity ?? getProperty(item.data, API.ITEM_QUANTITY_ATTRIBUTE)
}
});
diff --git a/scripts/systems.js b/scripts/systems.js
index 319b1db0..1345b1eb 100644
--- a/scripts/systems.js
+++ b/scripts/systems.js
@@ -3,7 +3,7 @@ import dnd5e from "./systems/dnd5e.js";
// ↓ IMPORT SYSTEMS HERE ↓
import pf1 from "./systems/pf1.js";
import ds4 from "./systems/ds4.js";
-import d35e from "./systems/ds4.js";
+import d35e from "./systems/d35e.js";
import swade from "./systems/swade.js";
import tormenta20 from "./systems/tormenta20.js";
// ↑ IMPORT SYSTEMS HERE ↑