File tree Expand file tree Collapse file tree
runelite-client/src/main/java/net/runelite/client/plugins/microbot/api/actor Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -76,7 +76,7 @@ public WorldPoint getWorldLocation()
7676 return Microbot .getClientThread ().invoke (this ::projectActorLocationToMainWorld );
7777 }
7878
79- return actor .getWorldLocation ();
79+ return Microbot . getClientThread (). runOnClientThreadOptional (() -> actor .getWorldLocation ()). orElse ( null );
8080 }
8181
8282 @ Override
@@ -450,7 +450,12 @@ public long getHash()
450450 }
451451
452452 public WorldPoint projectActorLocationToMainWorld () {
453- WorldPoint actorLocation = actor .getWorldLocation ();
453+ WorldPoint actorLocation = Microbot .getClientThread ().runOnClientThreadOptional (() -> actor .getWorldLocation ()).orElse (null );
454+ if (actorLocation == null )
455+ {
456+ return getWorldLocation ();
457+ }
458+
454459 LocalPoint localPoint = LocalPoint .fromWorld (
455460 getWorldView (),
456461 actorLocation
You can’t perform that action at this time.
0 commit comments