Fixed Fence assort generation failing when a child item that can be stacked is found, do not allow child items to be stacked. only root items
This commit is contained in:
parent
467927afeb
commit
df939c693f
@ -656,10 +656,13 @@ export class FenceService
|
|||||||
*/
|
*/
|
||||||
protected getMatchingItem(rootItemBeingAdded: Item, itemDbDetails: ITemplateItem, fenceItemAssorts: Item[]): Item
|
protected getMatchingItem(rootItemBeingAdded: Item, itemDbDetails: ITemplateItem, fenceItemAssorts: Item[]): Item
|
||||||
{
|
{
|
||||||
const matchingItems = fenceItemAssorts.filter((item) => item._tpl === rootItemBeingAdded._tpl);
|
// Get matching root items
|
||||||
|
const matchingItems = fenceItemAssorts.filter((item) =>
|
||||||
|
item._tpl === rootItemBeingAdded._tpl && item.parentId === "hideout"
|
||||||
|
);
|
||||||
if (matchingItems.length === 0)
|
if (matchingItems.length === 0)
|
||||||
{
|
{
|
||||||
// Nothing matches by tpl, exit early
|
// Nothing matches by tpl and is root item, exit early
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -717,6 +720,12 @@ export class FenceService
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Don't stack child items, only root items
|
||||||
|
if (existingItem.parentId !== "hideout")
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
// Item type in config list
|
// Item type in config list
|
||||||
return this.itemHelper.isOfBaseclasses(
|
return this.itemHelper.isOfBaseclasses(
|
||||||
itemDbDetails._id,
|
itemDbDetails._id,
|
||||||
|
Loading…
Reference in New Issue
Block a user