mirror of
https://github.com/sp-tarkov/server.git
synced 2025-02-13 09:50:43 -05:00
Small cleanup of setTraderOfferPurchaseLimits()
This commit is contained in:
parent
f263f8b0cb
commit
89459b9e5b
@ -251,14 +251,11 @@ export class RagfairController
|
|||||||
protected setTraderOfferPurchaseLimits(offer: IRagfairOffer, fullProfile: ISptProfile): void
|
protected setTraderOfferPurchaseLimits(offer: IRagfairOffer, fullProfile: ISptProfile): void
|
||||||
{
|
{
|
||||||
// No trader found, create a blank record for them
|
// No trader found, create a blank record for them
|
||||||
if (!fullProfile.traderPurchases[offer.user.id])
|
fullProfile.traderPurchases[offer.user.id] ||= {};
|
||||||
{
|
|
||||||
fullProfile.traderPurchases[offer.user.id] = {};
|
|
||||||
}
|
|
||||||
|
|
||||||
const traderAssorts = this.traderHelper.getTraderAssortsByTraderId(offer.user.id).items;
|
const traderAssorts = this.traderHelper.getTraderAssortsByTraderId(offer.user.id).items;
|
||||||
const assortId = offer.items[0]._id;
|
const assortId = offer.items[0]._id;
|
||||||
const assortData = traderAssorts.find((x) => x._id === assortId);
|
const assortData = traderAssorts.find((item) => item._id === assortId);
|
||||||
|
|
||||||
// Use value stored in profile, otherwise use value directly from in-memory trader assort data
|
// Use value stored in profile, otherwise use value directly from in-memory trader assort data
|
||||||
offer.buyRestrictionCurrent = fullProfile.traderPurchases[offer.user.id][assortId]
|
offer.buyRestrictionCurrent = fullProfile.traderPurchases[offer.user.id][assortId]
|
||||||
|
Loading…
x
Reference in New Issue
Block a user