0
0
mirror of https://github.com/sp-tarkov/server.git synced 2025-02-12 15:50:42 -05:00

Fixed checkForAndFixPickupQuestsAfterDeath() running when the player was alive

Removed old code that did the same but wasn't working
This commit is contained in:
Chomp 2024-11-24 18:29:04 +00:00
parent 92c2b11f71
commit effcc37e68
2 changed files with 1 additions and 24 deletions

View File

@ -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

View File

@ -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);