From bc6803752c5381921f3c6aa0cb30159119208e68 Mon Sep 17 00:00:00 2001 From: Fryslan Date: Sat, 15 Oct 2016 14:50:46 +0200 Subject: [PATCH] [FIX] Fixed WalkTo method for PKHonor. --- .../java/org/rev317/min/api/methods/Walking.java | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/src/main/java/org/rev317/min/api/methods/Walking.java b/src/main/java/org/rev317/min/api/methods/Walking.java index bbce3b8..8b065a7 100644 --- a/src/main/java/org/rev317/min/api/methods/Walking.java +++ b/src/main/java/org/rev317/min/api/methods/Walking.java @@ -1,5 +1,9 @@ package org.rev317.min.api.methods; + +import org.parabot.core.Context; +import org.parabot.core.reflect.RefClass; +import org.parabot.core.reflect.RefMethod; import org.rev317.min.Loader; import org.rev317.min.api.wrappers.Tile; import org.rev317.min.api.wrappers.TilePath; @@ -16,7 +20,13 @@ public class Walking { * @param to Tile to Walk To. */ public static void walkTo(Tile from, Tile to) { - Loader.getClient().walkTo(0, 0, 0, 0, from.getRegionY(), 0, 0, to.getRegionY(), from.getRegionX(), true, to.getRegionX()); + if (Context.getInstance().getServerProviderInfo().getServerName().toLowerCase().contentEquals("pkhonor")) { + RefClass refClass = new RefClass(Loader.getClient()); + RefMethod method = refClass.getMethod("walkTo"); + method.invoke(false,false,0, 0, 0, 0, from.getLocation().getRegionY(), 0, 0, to.getRegionY(), from.getLocation().getRegionX(), true, to.getRegionX()); + } else { + Loader.getClient().walkTo(0, 0, 0, 0, from.getRegionY(), 0, 0, to.getRegionY(), from.getRegionX(), true, to.getRegionX()); + } } /** @@ -25,7 +35,7 @@ public class Walking { * @param to Destination Tile. */ public static void walkTo(Tile to) { - Loader.getClient().walkTo(0, 0, 0, 0, Players.getMyPlayer().getLocation().getRegionY(), 0, 0, to.getRegionY(), Players.getMyPlayer().getLocation().getRegionX(), true, to.getRegionX()); + walkTo(Players.getMyPlayer().getLocation(), to); } /**