From a35ed657c250f1dd045eaa18af38d3a1751686a6 Mon Sep 17 00:00:00 2001 From: Dev Date: Sun, 24 Mar 2024 22:16:59 +0000 Subject: [PATCH] Persist fence standing gain on quest completion into scav profile --- project/src/helpers/TraderHelper.ts | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/project/src/helpers/TraderHelper.ts b/project/src/helpers/TraderHelper.ts index 3bbc14ed..4c609019 100644 --- a/project/src/helpers/TraderHelper.ts +++ b/project/src/helpers/TraderHelper.ts @@ -180,19 +180,26 @@ export class TraderHelper /** * Add standing to a trader and level them up if exp goes over level threshold - * @param sessionId Session id - * @param traderId Traders id + * @param sessionId Session id of player + * @param traderId Traders id to add standing to * @param standingToAdd Standing value to add to trader */ public addStandingToTrader(sessionId: string, traderId: string, standingToAdd: number): void { - const pmcData = this.profileHelper.getPmcProfile(sessionId); - const traderInfo = pmcData.TradersInfo[traderId]; + const fullProfile = this.profileHelper.getFullProfile(sessionId); + const pmcTraderInfo = fullProfile.characters.pmc.TradersInfo[traderId]; // Add standing to trader - traderInfo.standing = this.addStandingValuesTogether(traderInfo.standing, standingToAdd); + pmcTraderInfo.standing = this.addStandingValuesTogether(pmcTraderInfo.standing, standingToAdd); - this.lvlUp(traderId, pmcData); + if (traderId === Traders.FENCE) + { + // Must add rep to scav profile to ensure consistency + const fullProfile = this.profileHelper.getFullProfile(sessionId); + fullProfile.characters.scav.TradersInfo[traderId].standing = pmcTraderInfo.standing; + } + + this.lvlUp(traderId, fullProfile.characters.pmc); } /**