0
0
mirror of https://github.com/sp-tarkov/server.git synced 2025-02-13 02:10:44 -05:00

Resolved issue where weapon preset had its tpl overwritten with metal fuel containers tpl

This commit is contained in:
Chomp 2025-02-09 00:14:05 +00:00
parent b1a2f2d2c5
commit 0ae7afb335
2 changed files with 4 additions and 9 deletions

View File

@ -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<void> {
// 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 =

View File

@ -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;
}