From 765c2ae270178c50e231f67acb09304262d86cdc Mon Sep 17 00:00:00 2001 From: Dev Date: Fri, 12 Apr 2024 11:29:50 +0100 Subject: [PATCH] Only send failed message to player if failure message text length is great than 0 (after having whitespace trimmed) --- project/src/helpers/QuestHelper.ts | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/project/src/helpers/QuestHelper.ts b/project/src/helpers/QuestHelper.ts index c8b86078..0a09a68f 100644 --- a/project/src/helpers/QuestHelper.ts +++ b/project/src/helpers/QuestHelper.ts @@ -734,14 +734,17 @@ export class QuestHelper // Quest found and no repeatable found if (quest && !matchingRepeatableQuest) { - this.mailSendService.sendLocalisedNpcMessageToPlayer( - sessionID, - this.traderHelper.getTraderById(quest?.traderId ?? matchingRepeatableQuest?.traderId), // Can be null when repeatable quest has been moved to inactiveQuests - MessageType.QUEST_FAIL, - quest.failMessageText, - questRewards, - this.timeUtil.getHoursAsSeconds(this.questConfig.redeemTime), - ); + if (quest.failMessageText.trim().length > 0) + { + this.mailSendService.sendLocalisedNpcMessageToPlayer( + sessionID, + this.traderHelper.getTraderById(quest?.traderId ?? matchingRepeatableQuest?.traderId), // Can be null when repeatable quest has been moved to inactiveQuests + MessageType.QUEST_FAIL, + quest.failMessageText, + questRewards, + this.timeUtil.getHoursAsSeconds(this.questConfig.redeemTime), + ); + } } output.profileChanges[sessionID].quests.push(...this.failedUnlocked(failRequest.qid, sessionID));