Skip to content

Fix top level worldview, actor::getWorldLocation, reflection menu action descriptor#1706

Open
melxin wants to merge 3 commits intochsami:developmentfrom
melxin:fix-worldview-rev-237
Open

Fix top level worldview, actor::getWorldLocation, reflection menu action descriptor#1706
melxin wants to merge 3 commits intochsami:developmentfrom
melxin:fix-worldview-rev-237

Conversation

@melxin
Copy link
Copy Markdown
Contributor

@melxin melxin commented Mar 25, 2026

No description provided.

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai bot commented Mar 25, 2026

Walkthrough

This pull request refactors world-view ID comparisons across multiple files by replacing the magic value -1 with the named constant WorldView.TOPLEVEL. Changes include updating conditional logic in actor model and game object utilities, adjusting a default field initialization in menu entry utilities, and expanding the menu action method descriptor validation in reflection utilities to accept two variant descriptors (IIB and III argument types) instead of a single expected descriptor.

Possibly related PRs

🚥 Pre-merge checks | ✅ 1 | ❌ 2

❌ Failed checks (1 warning, 1 inconclusive)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
Description check ❓ Inconclusive No pull request description was provided by the author, making it impossible to evaluate relevance to the changeset. Add a description explaining why WorldView.TOPLEVEL is preferred over the literal -1 value and the impact of these changes.
✅ Passed checks (1 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately describes the main changes across four files: replacing hardcoded worldview sentinel values (-1) with WorldView.TOPLEVEL constant and updating reflection descriptors.

✏️ 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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

📥 Commits

Reviewing files that changed from the base of the PR and between c0f0684 and 0834686.

📒 Files selected for processing (4)
  • runelite-client/src/main/java/net/runelite/client/plugins/microbot/api/actor/Rs2ActorModel.java
  • runelite-client/src/main/java/net/runelite/client/plugins/microbot/util/gameobject/Rs2GameObject.java
  • runelite-client/src/main/java/net/runelite/client/plugins/microbot/util/menu/NewMenuEntry.java
  • runelite-client/src/main/java/net/runelite/client/plugins/microbot/util/reflection/Rs2Reflection.java

@melxin melxin force-pushed the fix-worldview-rev-237 branch from 0834686 to 541157b Compare March 25, 2026 20:17
@melxin melxin force-pushed the fix-worldview-rev-237 branch from e81e048 to dbbbe59 Compare March 26, 2026 01:08
@melxin melxin changed the title Fix top level worldview Fix top level worldview/actor::getWorldLocation Mar 26, 2026
@melxin melxin changed the title Fix top level worldview/actor::getWorldLocation Fix top level worldview, actor::getWorldLocation, reflection menu action descriptor Mar 26, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant