Commit e317b5d
fix(death): address review findings
Three of the four findings were valid:
1. getNearest used WorldPoint.distanceTo, which returns Integer.MAX_VALUE across
planes. Every entrance is on plane 0, so a player on any upper floor scored
MAX_VALUE for all eight and min() silently returned the first constant —
Lumbridge — however far away it was. Switched to distanceTo2D.
2. Two Javadoc blocks were orphaned when the item-reader methods were inserted
ahead of the methods they described: the grave "claims the half that costs
nothing" block landed on getGraveFreeItems, and the detailed reclaimAll block
(spending-limit rationale and @return) landed on getDeathsOfficeItems. Both
moved to the methods they document; no implementation change.
3. The Death's Office example in the guide called reclaimAll() unconditionally
under a comment about pricing the office first — stale since the fee estimator
was removed. It now reads the contents, leaves the decision to the caller, and
shows closeInterfaces() as the free way to decline.
The fourth — make reclaimItems resolve container and quantity buttons per retrieval
variant, mirroring reclaimAll — is not implementable as described. Confirmed against
the game cache (iftypes): death_office (669) has 1/5/x/all/takeall, while
gravestone_retrieval (602) has no quantity controls at all, only button /
button_bank / discard. There is nothing to resolve to. The real defect underneath it
was that reclaimItems read the DeathOffice container unconditionally even though
isDeathsOfficeOpen accepts either variant, so on 602 it would read an empty container
and report "took nothing". It now detects the variant and fails loudly, pointing the
caller at reclaimAll(). Both interfaces' component lists are documented in the guide.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>1 parent 5971e54 commit e317b5d
3 files changed
Lines changed: 51 additions & 26 deletions
File tree
- docs/entity-guides
- runelite-client/src/main/java/net/runelite/client/plugins/microbot/util/death
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
17 | 17 | | |
18 | 18 | | |
19 | 19 | | |
20 | | - | |
| 20 | + | |
21 | 21 | | |
22 | | - | |
23 | | - | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
24 | 29 | | |
25 | 30 | | |
26 | 31 | | |
| |||
353 | 358 | | |
354 | 359 | | |
355 | 360 | | |
| 361 | + | |
| 362 | + | |
| 363 | + | |
| 364 | + | |
| 365 | + | |
| 366 | + | |
| 367 | + | |
| 368 | + | |
| 369 | + | |
| 370 | + | |
| 371 | + | |
| 372 | + | |
356 | 373 | | |
357 | 374 | | |
358 | 375 | | |
| |||
Lines changed: 4 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
55 | 55 | | |
56 | 56 | | |
57 | 57 | | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
58 | 61 | | |
59 | | - | |
| 62 | + | |
60 | 63 | | |
61 | 64 | | |
62 | 65 | | |
Lines changed: 27 additions & 22 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
456 | 456 | | |
457 | 457 | | |
458 | 458 | | |
459 | | - | |
460 | | - | |
461 | | - | |
462 | 459 | | |
463 | 460 | | |
464 | 461 | | |
| |||
476 | 473 | | |
477 | 474 | | |
478 | 475 | | |
479 | | - | |
480 | | - | |
| 476 | + | |
| 477 | + | |
481 | 478 | | |
482 | 479 | | |
483 | 480 | | |
| |||
682 | 679 | | |
683 | 680 | | |
684 | 681 | | |
685 | | - | |
686 | | - | |
687 | | - | |
688 | | - | |
689 | | - | |
690 | | - | |
691 | | - | |
692 | | - | |
693 | | - | |
694 | | - | |
695 | | - | |
696 | | - | |
697 | | - | |
698 | | - | |
699 | | - | |
700 | 682 | | |
701 | 683 | | |
702 | 684 | | |
| |||
723 | 705 | | |
724 | 706 | | |
725 | 707 | | |
| 708 | + | |
| 709 | + | |
| 710 | + | |
| 711 | + | |
| 712 | + | |
| 713 | + | |
| 714 | + | |
| 715 | + | |
| 716 | + | |
| 717 | + | |
| 718 | + | |
726 | 719 | | |
727 | 720 | | |
728 | 721 | | |
| |||
748 | 741 | | |
749 | 742 | | |
750 | 743 | | |
751 | | - | |
752 | | - | |
| 744 | + | |
| 745 | + | |
| 746 | + | |
| 747 | + | |
| 748 | + | |
| 749 | + | |
| 750 | + | |
| 751 | + | |
| 752 | + | |
| 753 | + | |
| 754 | + | |
| 755 | + | |
| 756 | + | |
753 | 757 | | |
| 758 | + | |
754 | 759 | | |
755 | 760 | | |
756 | 761 | | |
| |||
0 commit comments