fix(eloot):v2.9.6 bugfix to check Bounty.task.done? when selling gems. - #2352
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughBumps ChangesVersion 2.9.6 Bug Fixes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Possibly related PRs
Suggested reviewers
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
scripts/eloot.lic (1)
5625-5659:⚠️ Potential issue | 🟠 Major | ⚡ Quick winGuard the outer sack loop once the bounty is complete.
Line 5652 only stops the per-item path. A later sack can still be bulk-sold after task completion because
gem_sacks.eachhas noBounty.task.done?guard.💡 Proposed fix
gem_sacks.each do |sack| + break if Bounty.task.done? next if sack.nil? next if sack.contents.none? { |obj| obj.name =~ /#{gem}/i } bulk_sell = true bulk_sell = false if sack.contents.any? { |obj| obj.name !~ /#{gem}/ && obj.type =~ /gem/ } @@ if bulk_sell Inventory.drag(sack) if [checkleft, checkright].index(sack.noun).nil? dothistimeout("sell ##{sack.id}", 3, /inspects the contents carefully/) Inventory.wear(sack) sleep 0.5🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@scripts/eloot.lic` around lines 5625 - 5659, The outer gem_sacks.each loop isn't guarded by Bounty.task.done?, so later sacks can still be bulk-sold after the bounty completes; add a guard at the top of the loop body (immediately after gem_sacks.each do |sack| and after the existing next if sack.nil? check) that breaks out of the loop when Bounty.task.done? is true (e.g., "break if Bounty.task.done?") so neither the bulk_sell branch nor the per-item path runs for subsequent sacks.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Outside diff comments:
In `@scripts/eloot.lic`:
- Around line 5625-5659: The outer gem_sacks.each loop isn't guarded by
Bounty.task.done?, so later sacks can still be bulk-sold after the bounty
completes; add a guard at the top of the loop body (immediately after
gem_sacks.each do |sack| and after the existing next if sack.nil? check) that
breaks out of the loop when Bounty.task.done? is true (e.g., "break if
Bounty.task.done?") so neither the bulk_sell branch nor the per-item path runs
for subsequent sacks.
Summary by CodeRabbit