Skip to content

Commit

Permalink
change from int to float calculations (#332)
Browse files Browse the repository at this point in the history
  • Loading branch information
Arto Simonyan committed Jul 1, 2024
1 parent 9a137de commit 5ef98de
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions internal/action/repair.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 5ef98de

Please sign in to comment.