From 7975ebafda4d29692678d0bdb2c4d4acb8077a2d Mon Sep 17 00:00:00 2001 From: Dev Date: Tue, 13 Feb 2024 13:07:26 +0000 Subject: [PATCH] Pass full profiles into `mergePmcAndScavEncyclopedias` --- project/src/controllers/InraidController.ts | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/project/src/controllers/InraidController.ts b/project/src/controllers/InraidController.ts index dfcb2330..fd2be79f 100644 --- a/project/src/controllers/InraidController.ts +++ b/project/src/controllers/InraidController.ts @@ -140,7 +140,7 @@ export class InraidController this.inRaidHelper.updateProfileBaseStats(serverPmcProfile, postRaidRequest, sessionID); this.inRaidHelper.updatePmcProfileDataPostRaid(serverPmcProfile, postRaidRequest, sessionID); - this.mergePmcAndScavEncyclopedias(serverPmcProfile.Encyclopedia, serverScavProfile.Encyclopedia); + this.mergePmcAndScavEncyclopedias(serverPmcProfile, serverScavProfile); // Check for exit status this.markOrRemoveFoundInRaidItems(postRaidRequest); @@ -336,7 +336,7 @@ export class InraidController this.inRaidHelper.updateProfileBaseStats(serverScavProfile, postRaidRequest, sessionID); this.inRaidHelper.updateScavProfileDataPostRaid(serverScavProfile, postRaidRequest, sessionID); - this.mergePmcAndScavEncyclopedias(serverScavProfile.Encyclopedia, serverPmcProfile.Encyclopedia); + this.mergePmcAndScavEncyclopedias(serverScavProfile, serverPmcProfile); // Completing scav quests create ConditionCounters, these values need to be transported to the PMC profile if (this.profileHasConditionCounters(serverScavProfile)) @@ -368,7 +368,7 @@ export class InraidController * @param primary main dictionary * @param secondary Secondary dictionary */ - protected mergePmcAndScavEncyclopedias(primary: Record, secondary: Record): void + protected mergePmcAndScavEncyclopedias(primary: IPmcData, secondary: IPmcData): void { function extend(target: { [key: string]: boolean; }, source: Record) { @@ -382,9 +382,9 @@ export class InraidController return target; } - const merged = extend(extend({}, primary), secondary); - primary = merged; - secondary = merged; + const merged = extend(extend({}, primary.Encyclopedia), secondary.Encyclopedia); + primary.Encyclopedia = merged; + secondary.Encyclopedia = merged; } /**