Handle some particular quest preconditions

This commit is contained in:
Liza 2024-12-26 22:28:50 +01:00
parent caf0034f26
commit 1e72aac22b
Signed by: liza
GPG Key ID: 2C41B84815CF6445

View File

@ -40,9 +40,9 @@ internal sealed class QuestInfo : IQuestInfo
PreviousQuests =
new List<PreviousQuestInfo>
{
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; }