Skip to content

Commit

Permalink
Fix some collectability thresholds
Browse files Browse the repository at this point in the history
  • Loading branch information
WorkingRobot committed Dec 3, 2024
1 parent 8ce9605 commit 853644b
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions Craftimizer/Utils/RecipeData.cs
Original file line number Diff line number Diff line change
Expand Up @@ -77,21 +77,21 @@ public RecipeData(ushort recipeId)
{
if (item.ItemId.RowId == Recipe.ItemResult.RowId)
{
thresholds = [0, item.CollectabilityMid, item.CollectabilityHigh];
thresholds = [item.CollectabilityMid, item.CollectabilityHigh];
break;
}
}
}
else if (Recipe.CollectableMetadata.GetValueOrDefault<CollectablesRefine>() is { } row6)
thresholds = [row6.CollectabilityLow, row6.CollectabilityMid, row6.CollectabilityHigh];

if (thresholds != null)
{
if (row6.CollectabilityHigh != 0)
thresholds = [row6.CollectabilityLow, row6.CollectabilityMid, row6.CollectabilityHigh];
else
thresholds = [0, row6.CollectabilityLow, row6.CollectabilityMid];
var t = thresholds.Where(t => t != 0).Cast<int?>();
t = Enumerable.Concat(Enumerable.Repeat((int?)null, 3 - t.Count()), t);
CollectableThresholds = t.ToArray();
}

CollectableThresholds = thresholds?.Select<int, int?>(t => t == 0 ? null : t).ToArray();

Ingredients = Recipe.Ingredient.Zip(Recipe.AmountIngredient)
.Take(6)
.Where(i => i.First.IsValid)
Expand Down

1 comment on commit 853644b

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Benchmark

Benchmark suite Current: 853644b Previous: f89203a Ratio
Craftimizer.Benchmark.Bench.Solve(State: AE572D59, Config: 0F58DCA3) 109515962.85714285 ns (± 359653.1165405948)
Craftimizer.Benchmark.Bench.Solve(State: C2F565C9, Config: 0F58DCA3) 75093829.59183672 ns (± 376530.84243525326)

This comment was automatically generated by workflow using github-action-benchmark.

Please sign in to comment.