From 2c50139dba9472a63e046e40f3fa76dd0df271b2 Mon Sep 17 00:00:00 2001 From: Dev Date: Thu, 25 Jan 2024 09:30:50 +0000 Subject: [PATCH] Round armor/weapon durability values to 2 DP --- project/src/helpers/DurabilityLimitsHelper.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/project/src/helpers/DurabilityLimitsHelper.ts b/project/src/helpers/DurabilityLimitsHelper.ts index 45d2abcb..1e7413b9 100644 --- a/project/src/helpers/DurabilityLimitsHelper.ts +++ b/project/src/helpers/DurabilityLimitsHelper.ts @@ -171,7 +171,7 @@ export class DurabilityLimitsHelper const minDelta = this.getMinWeaponDeltaFromConfig(botRole); const maxDelta = this.getMaxWeaponDeltaFromConfig(botRole); const delta = this.randomUtil.getInt(minDelta, maxDelta); - const result = maxDurability - delta; + const result = Number((maxDurability - delta).toFixed(2)); const durabilityValueMinLimit = Math.round( (this.getMinWeaponLimitPercentFromConfig(botRole) / 100) * maxDurability, ); @@ -185,7 +185,7 @@ export class DurabilityLimitsHelper const minDelta = this.getMinArmorDeltaFromConfig(botRole); const maxDelta = this.getMaxArmorDeltaFromConfig(botRole); const delta = this.randomUtil.getInt(minDelta, maxDelta); - const result = maxDurability - delta; + const result = Number((maxDurability - delta).toFixed(2)); const durabilityValueMinLimit = Math.round( (this.getMinArmorLimitPercentFromConfig(botRole) / 100) * maxDurability, );