Skip to content

Commit

Permalink
Fix rare crash with reusable ingredients, Closes #94
Browse files Browse the repository at this point in the history
  • Loading branch information
rubensworks committed May 13, 2023
1 parent 8cbb024 commit d9f4faf
Showing 1 changed file with 2 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1049,6 +1049,7 @@ public static <T, M> List<T> getIngredientRecipeInputs(IIngredientComponentStora
long prototypeQuantity = matcher.getQuantity(inputPrototype.getPrototype());
if (inputReusable && extractionMemoryReusable.contains(inputPrototype.getPrototype())) {
// If the reusable item has been extracted before, mark as valid, and don't extract again.
inputInstance = inputPrototype.getComponent().getMatcher().getEmptyInstance();
hasInputInstance = true;
shouldBreak = true;
} else {
Expand Down Expand Up @@ -1097,6 +1098,7 @@ public static <T, M> List<T> getIngredientRecipeInputs(IIngredientComponentStora
if (inputReusable) {
extractionMemoryReusableBuffer.add(inputPrototype.getPrototype());
}
inputInstance = inputPrototype.getComponent().getMatcher().getEmptyInstance();
hasInputInstance = true;
shouldBreak = true;
}
Expand Down

0 comments on commit d9f4faf

Please sign in to comment.