From 853644bae483873bb9a91411a2f74ab959f9bacf Mon Sep 17 00:00:00 2001 From: Asriel Camora Date: Mon, 2 Dec 2024 23:26:26 -0800 Subject: [PATCH] Fix some collectability thresholds --- Craftimizer/Utils/RecipeData.cs | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/Craftimizer/Utils/RecipeData.cs b/Craftimizer/Utils/RecipeData.cs index d1bde84..9a23e23 100644 --- a/Craftimizer/Utils/RecipeData.cs +++ b/Craftimizer/Utils/RecipeData.cs @@ -77,20 +77,20 @@ public sealed record RecipeData { if (item.ItemId.RowId == Recipe.ItemResult.RowId) { - thresholds = [0, item.CollectabilityMid, item.CollectabilityHigh]; + thresholds = [item.CollectabilityMid, item.CollectabilityHigh]; break; } } } else if (Recipe.CollectableMetadata.GetValueOrDefault() is { } row6) - { - if (row6.CollectabilityHigh != 0) - thresholds = [row6.CollectabilityLow, row6.CollectabilityMid, row6.CollectabilityHigh]; - else - thresholds = [0, row6.CollectabilityLow, row6.CollectabilityMid]; - } + thresholds = [row6.CollectabilityLow, row6.CollectabilityMid, row6.CollectabilityHigh]; - CollectableThresholds = thresholds?.Select(t => t == 0 ? null : t).ToArray(); + if (thresholds != null) + { + var t = thresholds.Where(t => t != 0).Cast(); + t = Enumerable.Concat(Enumerable.Repeat((int?)null, 3 - t.Count()), t); + CollectableThresholds = t.ToArray(); + } Ingredients = Recipe.Ingredient.Zip(Recipe.AmountIngredient) .Take(6)