Unlimit setTargetTile in RSSceneMixin

i have no idea if this actually even changes how it works but i got asked to pr it
This commit is contained in:
ThatGamerBlue
2019-06-10 18:27:53 +01:00
committed by GitHub
parent 9f4bf525e2
commit 400132771e

View File

@@ -702,26 +702,7 @@ public abstract class RSSceneMixin implements RSScene
@Inject
static void setTargetTile(int targetX, int targetY)
{
final LocalPoint current = client.getLocalPlayer().getLocalLocation();
// Limit walk distance - https://math.stackexchange.com/a/85582
final int a = current.getSceneX();
final int b = current.getSceneY();
final int c = targetX;
final int d = targetY;
final int r = MAX_TARGET_DISTANCE;
final int t = (int) Math.hypot(a - c, b - d) - r;
int x = targetX;
int y = targetY;
if (t > 0)
{
x = (r * c + t * a) / (r + t);
y = (r * d + t * b) / (r + t);
}
client.setSelectedSceneTileX(x);
client.setSelectedSceneTileY(y);
client.setSelectedSceneTileX(targetX);
client.setSelectedSceneTileY(targetY);
}
}