Mouse#leaveGame sometimes fails
Description of the bug (be specific): When calling Mouse.leaveGame(), sometimes the mouse will move to a random spot on the screen that isn't "off" the screen. It never used to do this prior to the update which allowed the mouse to leave random sides of the game screen.
How often the bug occurs: Sometimes when calling Mouse.leaveGame()
Triggers of the bug (if known): Calling Mouse.leaveGame()
Java version: N/A
Max Heap Size: N/A
TRiBot client version: TRiBot Version: TRiBot Release 10.4_0
Looking Glass (yes/no): No
Operating System: N/A
Script Name: N/A
TRiBot Old-School or RS3: OSRS
Client Debug: N/A
Bot Debug: N/A
Screenshots (if any):
Here is a gif of this in action. I am running the script code repetatively for about 35 seconds. As you can see, it works a majority of the time but sometimes it moves to a random spot on the screen. You'll have to watch most/all of the gif to see it, in the beginning it's working fine. The paint corresponds to the action so you can get an idea of when its inside Mouse#leaveGame. There's also quite a delay sometimes after moving the mouse off screen, although that's not the real issue.
private String status = "";
@Override
public void run() {
status = "Moving mouse to 300, 300";
Mouse.move(300, 300);
status = "Moving mouse off screen";
Mouse.leaveGame(true);
status = "finished";
}
@Override
public void onPaint(Graphics g) {
g.drawString("Status: " + status, 300, 300);
}