From 1e72aac22b1c4525a63a5c9205afaffc6474afcb Mon Sep 17 00:00:00 2001 From: Liza Carvelli Date: Thu, 26 Dec 2024 22:28:50 +0100 Subject: [PATCH] Handle some particular quest preconditions --- Questionable/Model/QuestInfo.cs | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/Questionable/Model/QuestInfo.cs b/Questionable/Model/QuestInfo.cs index 32f80ff4..6e60ac71 100644 --- a/Questionable/Model/QuestInfo.cs +++ b/Questionable/Model/QuestInfo.cs @@ -40,9 +40,9 @@ internal sealed class QuestInfo : IQuestInfo PreviousQuests = new List { - new(new QuestId((ushort)(quest.PreviousQuest[0].RowId & 0xFFFF)), quest.Unknown7), - new(new QuestId((ushort)(quest.PreviousQuest[1].RowId & 0xFFFF))), - new(new QuestId((ushort)(quest.PreviousQuest[2].RowId & 0xFFFF))) + new(ReplaceOldQuestIds((ushort)(quest.PreviousQuest[0].RowId & 0xFFFF)), quest.Unknown7), + new(ReplaceOldQuestIds((ushort)(quest.PreviousQuest[1].RowId & 0xFFFF))), + new(ReplaceOldQuestIds((ushort)(quest.PreviousQuest[2].RowId & 0xFFFF))) } .Where(x => x.QuestId.Value != 0) .ToImmutableList(); @@ -69,6 +69,15 @@ internal sealed class QuestInfo : IQuestInfo Expansion = (EExpansionVersion)quest.Expansion.RowId; } + private static QuestId ReplaceOldQuestIds(ushort questId) + { + return new QuestId(questId switch + { + 524 => 4522, + _ => questId, + }); + } + public ElementId QuestId { get; } public string Name { get; }