Fix top level worldview, actor::getWorldLocation, reflection menu action descriptor#1706
Fix top level worldview, actor::getWorldLocation, reflection menu action descriptor#1706melxin wants to merge 3 commits intochsami:developmentfrom
Conversation
WalkthroughThis pull request refactors world-view ID comparisons across multiple files by replacing the magic value Possibly related PRs
🚥 Pre-merge checks | ✅ 1 | ❌ 2❌ Failed checks (1 warning, 1 inconclusive)
✅ Passed checks (1 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. 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.
Actionable comments posted: 2
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In
`@runelite-client/src/main/java/net/runelite/client/plugins/microbot/api/actor/Rs2ActorModel.java`:
- Line 74: The branch calls getWorldView() twice which can yield inconsistent or
null values; capture the result once into a local variable (e.g., worldView)
before the if, then check if that local is non-null and its getId() !=
WorldView.TOPLEVEL (replace the double call in the Rs2ActorModel branch with a
single stored reference and use that for the null and id checks).
In
`@runelite-client/src/main/java/net/runelite/client/plugins/microbot/util/gameobject/Rs2GameObject.java`:
- Around line 1847-1848: Rs2GameObject currently only updates worldView when
object.getWorldView().getId() != WorldView.TOPLEVEL, causing top-level
interactions to keep the initial -1 id; change the logic so that when
object.getWorldView().getId() == WorldView.TOPLEVEL you explicitly assign
worldViewId = WorldView.TOPLEVEL (or otherwise set the worldView variable from
Microbot.getClient().getLocalPlayer().getWorldView() for the top-level case)
instead of leaving it as -1; locate the block around object.getWorldView(),
WorldView.TOPLEVEL, and the worldViewId variable and ensure the top-level branch
sets the correct WorldView constant before sending interactions.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Pro
Run ID: c41ecc63-38dd-4b4f-8f98-736e6b1efa39
📒 Files selected for processing (4)
runelite-client/src/main/java/net/runelite/client/plugins/microbot/api/actor/Rs2ActorModel.javarunelite-client/src/main/java/net/runelite/client/plugins/microbot/util/gameobject/Rs2GameObject.javarunelite-client/src/main/java/net/runelite/client/plugins/microbot/util/menu/NewMenuEntry.javarunelite-client/src/main/java/net/runelite/client/plugins/microbot/util/reflection/Rs2Reflection.java
runelite-client/src/main/java/net/runelite/client/plugins/microbot/api/actor/Rs2ActorModel.java
Outdated
Show resolved
Hide resolved
...client/src/main/java/net/runelite/client/plugins/microbot/util/gameobject/Rs2GameObject.java
Outdated
Show resolved
Hide resolved
0834686 to
541157b
Compare
e81e048 to
dbbbe59
Compare
No description provided.