v0.9.2: adjusted missile weapon durability logic to use rounding

This commit is contained in:
Evan Debenham 2021-02-05 12:37:49 -05:00
parent ef37060163
commit 653f2564d7

View File

@ -230,6 +230,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;