From 5ef98deeb03375de225c916a7fa144958514e08c Mon Sep 17 00:00:00 2001 From: Arto Simonyan Date: Tue, 2 Jul 2024 02:02:19 +0300 Subject: [PATCH] change from int to float calculations (#332) --- internal/action/repair.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/internal/action/repair.go b/internal/action/repair.go index da9ece89..9671d0b7 100644 --- a/internal/action/repair.go +++ b/internal/action/repair.go @@ -27,7 +27,7 @@ func (b *Builder) Repair() *Chain { durabilityPercent := -1 if maxDurabilityFound && found { - durabilityPercent = (durability.Value / maxDurability.Value) * 100 + durabilityPercent = int((float64(durability.Value) / float64(maxDurability.Value)) * 100) } if maxDurabilityFound && !found || durabilityPercent != -1 && found && durabilityPercent <= 20 || found && durability.Value <= 5 { @@ -83,7 +83,7 @@ func (b *Builder) RepairRequired() bool { durabilityPercent := -1 if maxDurabilityFound && currentDurabilityFound { - durabilityPercent = (currentDurability.Value / maxDurability.Value) * 100 + durabilityPercent = int((float64(currentDurability.Value) / float64(maxDurability.Value)) * 100) } // If we don't find the stats just continue