From 1c1ae28b69a45ac1040b3ff91105a1d3d756f79e Mon Sep 17 00:00:00 2001 From: Bernhard Bonigl Date: Sun, 19 Oct 2014 17:34:38 +0200 Subject: [PATCH] Fix Division through zero with Longbow with low weight arrows --- src/main/java/tconstruct/weaponry/weapons/LongBow.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/tconstruct/weaponry/weapons/LongBow.java b/src/main/java/tconstruct/weaponry/weapons/LongBow.java index 98aaf2d53dd..03d99ab1076 100644 --- a/src/main/java/tconstruct/weaponry/weapons/LongBow.java +++ b/src/main/java/tconstruct/weaponry/weapons/LongBow.java @@ -51,7 +51,7 @@ protected Entity createProjectile(ItemStack arrows, World world, EntityPlayer pl float weight = tags.getFloat("Mass"); // we need heavier arrows because we have POW. therefore we increase the weight penality on accuracy - accuracy += ((100f-matAccuracy)/10f)/(weight-1f); + accuracy += ((100f-matAccuracy)/10f)/Math.max(1f, weight-1f); if(accuracy < 0) accuracy = 0; }