pets issues fixed

This commit is contained in:
2025-02-09 20:42:00 -06:00
parent 354d0ab283
commit dbc0da20df
@@ -872,6 +872,11 @@ public class PlayerCombatStats {
} // PERFECT DO NOT TOUCH } // PERFECT DO NOT TOUCH
public static float getHitChance(int atr,int def){ public static float getHitChance(int atr,int def){
if(atr == 0)
return 0.0f;
if(def == 0)
return 100.0f;
float key = (float)((float)atr / def); float key = (float)((float)atr / def);
BigDecimal bd = new BigDecimal(key).setScale(2, RoundingMode.HALF_UP); BigDecimal bd = new BigDecimal(key).setScale(2, RoundingMode.HALF_UP);
key = bd.floatValue(); // handles rounding for mandatory 2 decimal places key = bd.floatValue(); // handles rounding for mandatory 2 decimal places