Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Apply one time quest filtering to social group quests #2375

Merged
merged 1 commit into from Jul 4, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
6 changes: 5 additions & 1 deletion Assets/Scripts/Game/Questing/QuestListsManager.cs
Expand Up @@ -342,6 +342,10 @@ public Quest GetSocialQuest(FactionFile.SocialGroups socialGroup, int factionId,
#if UNITY_EDITOR // Reload every time when in editor
LoadQuestLists();
#endif
// Create one-time quest list if not already created
if (oneTimeQuestsAccepted == null)
oneTimeQuestsAccepted = new List<string>();

List<QuestData> socialQuests;
if (social.TryGetValue(socialGroup, out socialQuests))
{
Expand All @@ -353,7 +357,7 @@ public Quest GetSocialQuest(FactionFile.SocialGroups socialGroup, int factionId,
(quest.membership == 'M' && gender == Genders.Male) ||
(quest.membership == 'F' && gender == Genders.Female)))
{
if (!quest.adult || DaggerfallUnity.Settings.PlayerNudity)
if ((!quest.adult || DaggerfallUnity.Settings.PlayerNudity) && !(quest.oneTime && oneTimeQuestsAccepted.Contains(quest.name)))
pool.Add(quest);
}
}
Expand Down