v0.9.2: adjusted missile weapon durability logic to use rounding
This commit is contained in:
parent
ef37060163
commit
653f2564d7
|
@ -231,6 +231,8 @@ abstract public class MissileWeapon extends Weapon {
|
||||||
//at 100 uses, items just last forever.
|
//at 100 uses, items just last forever.
|
||||||
if (usages >= 100f) return 0;
|
if (usages >= 100f) return 0;
|
||||||
|
|
||||||
|
usages = Math.round(usages);
|
||||||
|
|
||||||
//add a tiny amount to account for rounding error for calculations like 1/3
|
//add a tiny amount to account for rounding error for calculations like 1/3
|
||||||
return (MAX_DURABILITY/usages) + 0.001f;
|
return (MAX_DURABILITY/usages) + 0.001f;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user