Only send failed message to player if failure message text length is great than 0 (after having whitespace trimmed)

This commit is contained in:
Dev 2024-04-12 11:29:50 +01:00
parent 364e590960
commit 765c2ae270

View File

@ -734,14 +734,17 @@ export class QuestHelper
// Quest found and no repeatable found // Quest found and no repeatable found
if (quest && !matchingRepeatableQuest) if (quest && !matchingRepeatableQuest)
{ {
this.mailSendService.sendLocalisedNpcMessageToPlayer( if (quest.failMessageText.trim().length > 0)
sessionID, {
this.traderHelper.getTraderById(quest?.traderId ?? matchingRepeatableQuest?.traderId), // Can be null when repeatable quest has been moved to inactiveQuests this.mailSendService.sendLocalisedNpcMessageToPlayer(
MessageType.QUEST_FAIL, sessionID,
quest.failMessageText, this.traderHelper.getTraderById(quest?.traderId ?? matchingRepeatableQuest?.traderId), // Can be null when repeatable quest has been moved to inactiveQuests
questRewards, MessageType.QUEST_FAIL,
this.timeUtil.getHoursAsSeconds(this.questConfig.redeemTime), quest.failMessageText,
); questRewards,
this.timeUtil.getHoursAsSeconds(this.questConfig.redeemTime),
);
}
} }
output.profileChanges[sessionID].quests.push(...this.failedUnlocked(failRequest.qid, sessionID)); output.profileChanges[sessionID].quests.push(...this.failedUnlocked(failRequest.qid, sessionID));