Make use of itemHelper.isOfBaseclasses() inside duplicate fence offer check

Can now handle items that have a blacklisted grandparent
This commit is contained in:
Dev 2024-03-05 08:52:21 +00:00
parent 0740a84f6f
commit 8f4df131ac

View File

@ -608,16 +608,14 @@ export class FenceService
this.itemHelper.remapRootItemId(desiredAssortItemAndChildrenClone);
const rootItemBeingAdded = desiredAssortItemAndChildrenClone[0];
rootItemBeingAdded.upd.StackObjectsCount = this.getSingleItemStackCount(itemDbDetails);
// rootItemBeingAdded.upd.BuyRestrictionCurrent = 0;
// rootItemBeingAdded.upd.UnlimitedCount = false;
// Skip items already in the assort if it exists in the prevent duplicate list
if (
assorts.items.some((item) => item._tpl === rootItemBeingAdded._tpl)
&& this.traderConfig.fence.preventDuplicateOffersOfCategory.includes(
this.itemHelper.getItem(rootItemBeingAdded._tpl)[1]._parent,
&& this.itemHelper.isOfBaseclasses(
rootItemBeingAdded._tpl,
this.traderConfig.fence.preventDuplicateOffersOfCategory,
)
)
{