From dd6d7e192f4b127a138c19ab4c5e329fa6e53317 Mon Sep 17 00:00:00 2001 From: Dev Date: Fri, 26 Apr 2024 14:06:18 +0100 Subject: [PATCH] Fixed coop exit usage not updating scav profile fence rep value in a similar way to car extracts do --- project/src/controllers/MatchController.ts | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/project/src/controllers/MatchController.ts b/project/src/controllers/MatchController.ts index 4869e4b8..60b69751 100644 --- a/project/src/controllers/MatchController.ts +++ b/project/src/controllers/MatchController.ts @@ -173,7 +173,7 @@ export class MatchController if (extractName && this.extractWasViaCoop(extractName) && this.traderConfig.fence.coopExtractGift.sendGift) { - this.handleCoopExtract(pmcData, extractName); + this.handleCoopExtract(sessionId, pmcData, extractName); this.sendCoopTakenFenceMessage(sessionId); } } @@ -225,10 +225,11 @@ export class MatchController /** * Handle when a player extracts using a coop extract - add rep to fence + * @param sessionId Session/player id * @param pmcData Profile * @param extractName Name of extract taken */ - protected handleCoopExtract(pmcData: IPmcData, extractName: string): void + protected handleCoopExtract(sessionId: string, pmcData: IPmcData, extractName: string): void { if (!pmcData.CoopExtractCounts) { @@ -256,6 +257,11 @@ export class MatchController // Check if new standing has leveled up trader this.traderHelper.lvlUp(fenceId, pmcData); pmcData.TradersInfo[fenceId].loyaltyLevel = Math.max(pmcData.TradersInfo[fenceId].loyaltyLevel, 1); + + // Copy updated fence rep values into scav profile to ensure consistency + const scavData: IPmcData = this.profileHelper.getScavProfile(sessionId); + scavData.TradersInfo[fenceId].standing = pmcData.TradersInfo[fenceId].standing; + scavData.TradersInfo[fenceId].loyaltyLevel = pmcData.TradersInfo[fenceId].loyaltyLevel; } /** @@ -313,6 +319,7 @@ export class MatchController this.logger.debug( `Car extract: ${extractName} used, total times taken: ${pmcData.CarExtractCounts[extractName]}`, ); + // Copy updated fence rep values into scav profile to ensure consistency const scavData: IPmcData = this.profileHelper.getScavProfile(sessionId); scavData.TradersInfo[fenceId].standing = pmcData.TradersInfo[fenceId].standing;