Fix Division through zero with Longbow with low weight arrows

This commit is contained in:
Bernhard Bonigl committed 2014-10-19 17:34:38 +02:00
1 parent cb33bb1b72
commit 1c1ae28b69
1 file changed
+1 -1
@@ -51,7 +51,7 @@ public class LongBow extends BowBaseAmmo {
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;
}