diff --git a/RespecWrath/Main.cs b/RespecWrath/Main.cs index 570b9aa..a19659a 100644 --- a/RespecWrath/Main.cs +++ b/RespecWrath/Main.cs @@ -914,24 +914,20 @@ public static void PatchLibrary() { Main.logger.Log("Library data gathering initiated"); DeityBackground.DeityFeatures = DeityBackground.DeitySelect?.AllFeatures.Select(a => a).ToArray(); - var tempbackgroundlist = new List(); - tempbackgroundlist.Add(DeityBackground.BackgroundSelect); - foreach (var background in DeityBackground.BackgroundSelect?.AllFeatures) + List tempbackgroundlist = [DeityBackground.BackgroundSelect]; + foreach (var background in DeityBackground.BackgroundSelect?.AllFeatures.NotNull() ?? []) { - if (background != null) + tempbackgroundlist.Add(background); + if (background is BlueprintFeatureSelection background1) { - tempbackgroundlist.Add(background); - if (background.GetType() == typeof(BlueprintFeatureSelection)) + foreach (var selection in background1?.AllFeatures.NotNull() ?? []) { - foreach (var selection in ((BlueprintFeatureSelection)background)?.AllFeatures) + tempbackgroundlist.Add(selection); + if (selection is BlueprintFeatureSelection selection1) { - tempbackgroundlist.Add(selection); - if (selection.GetType() == typeof(BlueprintFeatureSelection)) + foreach (var selection2 in selection1?.AllFeatures.NotNull() ?? []) { - foreach (var selection2 in ((BlueprintFeatureSelection)selection)?.AllFeatures) - { tempbackgroundlist.Add(selection2); - } } } } @@ -1049,4 +1045,4 @@ public enum ExtraPointsType P25 } } -} \ No newline at end of file +}