Skip to content

Commit

Permalink
Fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
Haxxer committed Sep 2, 2024
1 parent 6d6b53c commit 4634f16
Showing 1 changed file with 12 additions and 12 deletions.
24 changes: 12 additions & 12 deletions src/helpers/utilities.js
Original file line number Diff line number Diff line change
Expand Up @@ -151,20 +151,20 @@ export function getDocumentTemplates(templateType) {
*/
export function getItemTypesThatCanStack() {

itemTypesWithQuantities ??= new Set();

if (game.system.id === "custom-system-builder") {
const quantityAttribute = game.itempiles.API.ITEM_QUANTITY_ATTRIBUTE.split(".").pop();
const itemTemplates = game.items
.filter(_i => _i?.templateSystem?.isTemplate && _i?.templateSystem?.getKeys)
.filter(_i => _i.templateSystem.getKeys().has(quantityAttribute));
for (const item of itemTemplates) {
itemTypesWithQuantities.add(item.name);
}
}

if (!itemTypesWithQuantities) {

itemTypesWithQuantities = new Set();

if (game.system.id === "custom-system-builder") {
const quantityAttribute = game.itempiles.API.ITEM_QUANTITY_ATTRIBUTE.split(".").pop();
const itemTemplates = game.items
.filter(_i => _i?.templateSystem?.isTemplate && _i?.templateSystem?.getKeys)
.filter(_i => _i.templateSystem.getKeys().has(quantityAttribute));
for (const item of itemTemplates) {
itemTypesWithQuantities.add(item.name);
}
}

const unstackableItemTypes = Helpers.getSetting(SETTINGS.UNSTACKABLE_ITEM_TYPES);
const templates = getDocumentTemplates("Item");
const types = new Set(Object.keys(templates));
Expand Down

0 comments on commit 4634f16

Please sign in to comment.