Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Restructured conditionals #401

Merged
merged 3 commits into from
Aug 12, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
Restructured conditionals in an attempt to fix problem with rconstant…
…ly trying to repair 100% durability items
  • Loading branch information
Jan committed Aug 11, 2024
commit 0e9c655aadf09126250d4d191e90339c33dec2dc
5 changes: 4 additions & 1 deletion internal/action/repair.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,10 @@ func (b *Builder) Repair() *Chain {
durabilityPercent = int((float64(durability.Value) / float64(maxDurability.Value)) * 100)
}

if maxDurabilityFound && !found || durabilityPercent != -1 && found && durabilityPercent <= 20 || found && durability.Value <= 5 {
// Restructured conditionals for when to attempt repair
if (maxDurabilityFound && !found) ||
(durabilityPercent != -1 && found && durabilityPercent <= 20) ||
(found && durability.Value <= 5) {

b.Logger.Info(fmt.Sprintf("Repairing %s, item durability is %d percent", i.Name, durabilityPercent))

Expand Down