Persist fence standing gain on quest completion into scav profile

This commit is contained in:
Dev 2024-03-24 22:16:59 +00:00
parent eca6f4bd75
commit a35ed657c2

View File

@ -180,19 +180,26 @@ export class TraderHelper
/** /**
* Add standing to a trader and level them up if exp goes over level threshold * Add standing to a trader and level them up if exp goes over level threshold
* @param sessionId Session id * @param sessionId Session id of player
* @param traderId Traders id * @param traderId Traders id to add standing to
* @param standingToAdd Standing value to add to trader * @param standingToAdd Standing value to add to trader
*/ */
public addStandingToTrader(sessionId: string, traderId: string, standingToAdd: number): void public addStandingToTrader(sessionId: string, traderId: string, standingToAdd: number): void
{ {
const pmcData = this.profileHelper.getPmcProfile(sessionId); const fullProfile = this.profileHelper.getFullProfile(sessionId);
const traderInfo = pmcData.TradersInfo[traderId]; const pmcTraderInfo = fullProfile.characters.pmc.TradersInfo[traderId];
// Add standing to trader // 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);
} }
/** /**