Fixed floating point bug if productionModifier is negative

This commit is contained in:
Gabriel Eiseman committed 2023-07-14 18:17:21 -04:00
1 parent 22ff1f569a
commit 7ffee78d26
1 file changed
+3
@@ -551,6 +551,9 @@ public class Bee extends IndividualLiving implements IBee {
}
public static float getFinalChance(float chance, float beeSpeed, float productionModifier, float t) {
if (productionModifier < 0) {
return 0;
}
chance *= 100f;
return (float) (2.8 * Math.pow(chance, 0.52)
* Math.pow((productionModifier + t), 0.52)