Skip to content

Commit

Permalink
worldpoint: use signed right shift for local to world conversion
Browse files Browse the repository at this point in the history
  • Loading branch information
Adam- committed Jan 21, 2024
1 parent 617b4d9 commit 8e71929
Showing 1 changed file with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -176,8 +176,8 @@ public static WorldPoint fromLocal(Client client, LocalPoint local)
public static WorldPoint fromLocal(Scene scene, int x, int y, int plane)
{
return new WorldPoint(
(x >>> Perspective.LOCAL_COORD_BITS) + scene.getBaseX(),
(y >>> Perspective.LOCAL_COORD_BITS) + scene.getBaseY(),
(x >> Perspective.LOCAL_COORD_BITS) + scene.getBaseX(),
(y >> Perspective.LOCAL_COORD_BITS) + scene.getBaseY(),
plane
);
}
Expand All @@ -194,8 +194,8 @@ public static WorldPoint fromLocal(Scene scene, int x, int y, int plane)
public static WorldPoint fromLocal(Client client, int x, int y, int plane)
{
return new WorldPoint(
(x >>> Perspective.LOCAL_COORD_BITS) + client.getBaseX(),
(y >>> Perspective.LOCAL_COORD_BITS) + client.getBaseY(),
(x >> Perspective.LOCAL_COORD_BITS) + client.getBaseX(),
(y >> Perspective.LOCAL_COORD_BITS) + client.getBaseY(),
plane
);
}
Expand Down

0 comments on commit 8e71929

Please sign in to comment.