Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 18 additions & 2 deletions Assets/Gothic-Core/Scripts/Services/Player/DialogService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -138,9 +138,16 @@ public void StartDialog(NpcContainer npcContainer, bool initialDialogStarting)
_gameStateService.Dialogs.IsChoosing = true;
_gameStateService.Dialogs.ExitInfo = null;
}
// There is at least one important entry, the NPC wants to talk to the hero about.
else if (initialDialogStarting && TryGetImportant(npcContainer, out var infoInstance))
// There is at least one important entry, the NPC wants to talk to the hero about. Like the engine, after
// one important info the next one starts by itself (G2 Hanna: her greeting, then the thieves' cellar one),
// not only when the dialog starts. A permanent important info only at the start - it would repeat forever.
else if (TryGetImportant(npcContainer, out var infoInstance) &&
(initialDialogStarting || infoInstance.Permanent != 1))
{
if (!initialDialogStarting)
Logger.Log($"[Dialog] {npcContainer.Instance.GetName(NpcNameSlot.Slot0)}: next important info " +
$"{infoInstance.Index} (nr {infoInstance.Nr}) starts by itself", LogCat.Dialog);

_gameStateService.Dialogs.CurrentInstance = infoInstance;
CallMainInformation(npcContainer, infoInstance);
}
Expand All @@ -164,6 +171,15 @@ public void StartDialog(NpcContainer npcContainer, bool initialDialogStarting)
continue;
}

// Important infos are the NPC's to start, never a choice for the hero: they have no description
// and showed up as an empty option (G2 Hanna's cellar info).
if (dialog.Important == 1)
{
Logger.Log($"[Dialog] {npcContainer.Instance.GetName(NpcNameSlot.Slot0)}: important info " +
$"{dialog.Index} (nr {dialog.Nr}) is not a choice", LogCat.Dialog);
continue;
}

// We can now add the dialog
selectableDialogs.Add(dialog);
}
Expand Down