From effcc37e68bf2fcce0a571b7a72190fd58daac21 Mon Sep 17 00:00:00 2001 From: Chomp Date: Sun, 24 Nov 2024 18:29:04 +0000 Subject: [PATCH] Fixed `checkForAndFixPickupQuestsAfterDeath()` running when the player was alive Removed old code that did the same but wasn't working --- project/src/helpers/InRaidHelper.ts | 17 ----------------- .../src/services/LocationLifecycleService.ts | 8 +------- 2 files changed, 1 insertion(+), 24 deletions(-) diff --git a/project/src/helpers/InRaidHelper.ts b/project/src/helpers/InRaidHelper.ts index 7ac7dd60..c10e0db0 100644 --- a/project/src/helpers/InRaidHelper.ts +++ b/project/src/helpers/InRaidHelper.ts @@ -190,23 +190,6 @@ export class InRaidHelper { } } - /** - * Deletes quest conditions from pickup tasks given a list of quest items being carried by a PMC. - * @param carriedQuestItems Items carried by PMC at death, usually gotten from "CarriedQuestItems" - * @param sessionId Current sessionId - * @param pmcProfile Pre-raid profile that is being handled with raid information - */ - public removePickupQuestConditions(carriedQuestItems: string[], sessionId: string, pmcProfile: IPmcData) { - if (carriedQuestItems && this.lostOnDeathConfig.questItems) { - const pmcQuests = this.questController.getClientQuests(sessionId); - const pmcQuestIds = pmcQuests.map((a) => a._id); - for (const item of carriedQuestItems) { - const failedQuestId = this.questHelper.getFindItemConditionByQuestItem(item, pmcQuestIds, pmcQuests); - this.profileHelper.removeQuestConditionFromProfile(pmcProfile, failedQuestId); - } - } - } - /** * Get an array of items from a profile that will be lost on death * @param pmcProfile Profile to get items from diff --git a/project/src/services/LocationLifecycleService.ts b/project/src/services/LocationLifecycleService.ts index 8cf6dccc..08c10d11 100644 --- a/project/src/services/LocationLifecycleService.ts +++ b/project/src/services/LocationLifecycleService.ts @@ -655,7 +655,7 @@ export class LocationLifecycleService { pmcProfile.Achievements = postRaidProfile.Achievements; pmcProfile.Quests = this.processPostRaidQuests(postRaidProfile.Quests); - if (lostQuestItems.length > 0) { + if (isDead && lostQuestItems.length > 0) { // MUST occur AFTER quests have post raid quest data has been merged // Player is dead + had quest items, check and fix any broken find item quests this.checkForAndFixPickupQuestsAfterDeath(sessionId, lostQuestItems, pmcProfile.Quests); @@ -692,12 +692,6 @@ export class LocationLifecycleService { this.healthHelper.updateProfileHealthPostRaid(pmcProfile, postRaidProfile.Health, sessionId, isDead); if (isDead) { - this.inRaidHelper.removePickupQuestConditions( - postRaidProfile.Stats.Eft.CarriedQuestItems, - sessionId, - pmcProfile, - ); - this.pmcChatResponseService.sendKillerResponse(sessionId, pmcProfile, postRaidProfile.Stats.Eft.Aggressor); this.inRaidHelper.deleteInventory(pmcProfile, sessionId);