Skip start condition lookup from original quest file if it cant be found, show warning if this occurs

This commit is contained in:
Chomp 2022-01-12 11:48:23 +00:00
parent 4ffebab448
commit 8940751fac

View File

@ -66,6 +66,12 @@ namespace GenerateQuestFile
var originalQuest = existingQuestData.FirstOrDefault(x => x.Key == quest.Key).Value; var originalQuest = existingQuestData.FirstOrDefault(x => x.Key == quest.Key).Value;
if (originalQuest is null)
{
LoggingHelpers.LogWarning($"Cant check for original start conditions. Unable to find original quest {quest.Key} {QuestHelper.GetQuestNameById(quest.Key)}. skipping.");
continue;
}
// quest has start conditions, check to ensure they're carried over // quest has start conditions, check to ensure they're carried over
if (originalQuest.conditions.AvailableForStart.Count > 0) if (originalQuest.conditions.AvailableForStart.Count > 0)
{ {