diff --git a/project/src/generators/RagfairOfferGenerator.ts b/project/src/generators/RagfairOfferGenerator.ts index 4e8c8cad..89bc072e 100644 --- a/project/src/generators/RagfairOfferGenerator.ts +++ b/project/src/generators/RagfairOfferGenerator.ts @@ -351,7 +351,7 @@ export class RagfairOfferGenerator { // get assort items from param if they exist, otherwise grab freshly generated assorts const assortItemsToProcess: IItem[][] = replacingExpiredOffers - ? expiredOffers ?? [] + ? (expiredOffers ?? []) : this.ragfairAssortGenerator.getAssortItems(); // Create offers for each item set concurrently @@ -471,10 +471,8 @@ export class RagfairOfferGenerator { itemToSellDetails: ITemplateItem, ): Promise { // Set stack size to random value - itemWithChildren[0].upd.StackObjectsCount = this.ragfairServerHelper.calculateDynamicStackCount( - itemWithChildren[0]._tpl, - isPreset, - ); + var desiredStackSize = this.ragfairServerHelper.calculateDynamicStackCount(itemWithChildren[0]._tpl, isPreset); + itemWithChildren[0].upd.StackObjectsCount = desiredStackSize; const isBarterOffer = this.randomUtil.getChance100(this.ragfairConfig.dynamic.barter.chancePercent); const isPackOffer = diff --git a/project/src/helpers/RagfairServerHelper.ts b/project/src/helpers/RagfairServerHelper.ts index 5595cf2b..2413b09c 100644 --- a/project/src/helpers/RagfairServerHelper.ts +++ b/project/src/helpers/RagfairServerHelper.ts @@ -163,10 +163,7 @@ export class RagfairServerHelper { } // Item Types to return one of - if ( - isWeaponPreset || - this.itemHelper.isOfBaseclasses(itemDetails[1]._id, this.ragfairConfig.dynamic.showAsSingleStack) - ) { + if (isWeaponPreset || this.itemHelper.isOfBaseclasses(tplId, this.ragfairConfig.dynamic.showAsSingleStack)) { return 1; }