Skip to content

Commit 853644b

Browse files
committed
Fix some collectability thresholds
1 parent 8ce9605 commit 853644b

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

Craftimizer/Utils/RecipeData.cs

+7-7
Original file line numberDiff line numberDiff line change
@@ -77,21 +77,21 @@ public RecipeData(ushort recipeId)
7777
{
7878
if (item.ItemId.RowId == Recipe.ItemResult.RowId)
7979
{
80-
thresholds = [0, item.CollectabilityMid, item.CollectabilityHigh];
80+
thresholds = [item.CollectabilityMid, item.CollectabilityHigh];
8181
break;
8282
}
8383
}
8484
}
8585
else if (Recipe.CollectableMetadata.GetValueOrDefault<CollectablesRefine>() is { } row6)
86+
thresholds = [row6.CollectabilityLow, row6.CollectabilityMid, row6.CollectabilityHigh];
87+
88+
if (thresholds != null)
8689
{
87-
if (row6.CollectabilityHigh != 0)
88-
thresholds = [row6.CollectabilityLow, row6.CollectabilityMid, row6.CollectabilityHigh];
89-
else
90-
thresholds = [0, row6.CollectabilityLow, row6.CollectabilityMid];
90+
var t = thresholds.Where(t => t != 0).Cast<int?>();
91+
t = Enumerable.Concat(Enumerable.Repeat((int?)null, 3 - t.Count()), t);
92+
CollectableThresholds = t.ToArray();
9193
}
9294

93-
CollectableThresholds = thresholds?.Select<int, int?>(t => t == 0 ? null : t).ToArray();
94-
9595
Ingredients = Recipe.Ingredient.Zip(Recipe.AmountIngredient)
9696
.Take(6)
9797
.Where(i => i.First.IsValid)

0 commit comments

Comments
 (0)