0
0
mirror of https://github.com/sp-tarkov/server.git synced 2025-02-13 01:30: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 // get assort items from param if they exist, otherwise grab freshly generated assorts
const assortItemsToProcess: IItem[][] = replacingExpiredOffers const assortItemsToProcess: IItem[][] = replacingExpiredOffers
? expiredOffers ?? [] ? (expiredOffers ?? [])
: this.ragfairAssortGenerator.getAssortItems(); : this.ragfairAssortGenerator.getAssortItems();
// Create offers for each item set concurrently // Create offers for each item set concurrently
@ -471,10 +471,8 @@ export class RagfairOfferGenerator {
itemToSellDetails: ITemplateItem, itemToSellDetails: ITemplateItem,
): Promise<void> { ): Promise<void> {
// Set stack size to random value // Set stack size to random value
itemWithChildren[0].upd.StackObjectsCount = this.ragfairServerHelper.calculateDynamicStackCount( var desiredStackSize = this.ragfairServerHelper.calculateDynamicStackCount(itemWithChildren[0]._tpl, isPreset);
itemWithChildren[0]._tpl, itemWithChildren[0].upd.StackObjectsCount = desiredStackSize;
isPreset,
);
const isBarterOffer = this.randomUtil.getChance100(this.ragfairConfig.dynamic.barter.chancePercent); const isBarterOffer = this.randomUtil.getChance100(this.ragfairConfig.dynamic.barter.chancePercent);
const isPackOffer = const isPackOffer =

View File

@ -163,10 +163,7 @@ export class RagfairServerHelper {
} }
// Item Types to return one of // Item Types to return one of
if ( if (isWeaponPreset || this.itemHelper.isOfBaseclasses(tplId, this.ragfairConfig.dynamic.showAsSingleStack)) {
isWeaponPreset ||
this.itemHelper.isOfBaseclasses(itemDetails[1]._id, this.ragfairConfig.dynamic.showAsSingleStack)
) {
return 1; return 1;
} }