Skip to content

Commit

Permalink
Don't crash with divide by zero error
Browse files Browse the repository at this point in the history
  • Loading branch information
mitchej123 committed Feb 14, 2021
1 parent ebbfd34 commit 34b9998
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/codechicken/nei/recipe/DefaultOverlayHandler.java
Original file line number Diff line number Diff line change
Expand Up @@ -228,7 +228,7 @@ private List<IngredientDistribution> assignIngredients(List<PositionedStack> ing
for(ItemStack pstack : posstack.items)
{
for (DistributedIngred istack : ingredStacks) {
if (!canStack(pstack, istack.stack) || istack.invAmount - istack.distributed < pstack.stackSize)
if (!canStack(pstack, istack.stack) || istack.invAmount - istack.distributed < pstack.stackSize || istack.recipeAmount == 0 || istack.distributed == 0 || pstack.stackSize == 0)
continue;

int relsize = (istack.invAmount - istack.invAmount / istack.recipeAmount * istack.distributed) / pstack.stackSize;
Expand Down

0 comments on commit 34b9998

Please sign in to comment.