Handle accepting quests via 'PickupQuestId' if NPC offers multiple quests

pull/40/head
Liza 2024-08-30 21:40:42 +02:00
parent a5d75eb0f5
commit de7cf2a94f
Signed by: liza
GPG Key ID: 7199F8D727D55F67
1 changed files with 10 additions and 0 deletions

View File

@ -235,6 +235,16 @@ internal sealed class InteractionUiController : IDisposable
_logger.LogInformation("Checking if current quest {Name} is on the list", currentQuest.Quest.Info.Name);
if (CheckQuestSelection(addonSelectIconString, currentQuest.Quest, answers))
return;
var sequence = currentQuest.Quest.FindSequence(currentQuest.Sequence);
QuestStep? step = sequence?.FindStep(currentQuest.Step);
if (step is { InteractionType: EInteractionType.AcceptQuest, PickUpQuestId: not null } &&
_questRegistry.TryGetQuest(step.PickUpQuestId, out Quest? pickupQuest))
{
_logger.LogInformation("Checking if current picked-up {Name} is on the list", pickupQuest.Info.Name);
if (CheckQuestSelection(addonSelectIconString, pickupQuest, answers))
return;
}
}
var nextQuest = _questController.NextQuest;