pets issues fixed
This commit is contained in:
1 parent
354d0ab283
commit
dbc0da20df
1 file changed
+5
@@ -872,6 +872,11 @@ public class PlayerCombatStats {
|
||||
} // PERFECT DO NOT TOUCH
|
||||
|
||||
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);
|
||||
BigDecimal bd = new BigDecimal(key).setScale(2, RoundingMode.HALF_UP);
|
||||
key = bd.floatValue(); // handles rounding for mandatory 2 decimal places
|
||||
|
||||
Reference in new issue
Block a user