From 96b39afd59c37a228d7160c65f731c18a1a102b5 Mon Sep 17 00:00:00 2001 From: JKetelaar Date: Mon, 17 Oct 2016 01:36:50 +0200 Subject: [PATCH] [BUGFIX] Proper pkhonor walking method --- src/main/java/org/rev317/min/accessors/Client.java | 2 ++ src/main/java/org/rev317/min/api/methods/Walking.java | 10 +++------- 2 files changed, 5 insertions(+), 7 deletions(-) diff --git a/src/main/java/org/rev317/min/accessors/Client.java b/src/main/java/org/rev317/min/accessors/Client.java index 430797f..10ae439 100644 --- a/src/main/java/org/rev317/min/accessors/Client.java +++ b/src/main/java/org/rev317/min/accessors/Client.java @@ -49,6 +49,8 @@ public interface Client { // args switched boolean walkTo(int clickType, int sizeX, int sizeY, int startX, int startY, int destX, int destY, int type, int face, boolean arbitrary, int rotation); + boolean walkToPKH(boolean flag1, boolean flag2, int clickType, int sizeX, int sizeY, int startX, int startY, int destX, int destY, int type, int face, boolean arbitrary, int rotation); + void doAction(int i); void dropClient(); 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 8b065a7..4cc026a 100644 --- a/src/main/java/org/rev317/min/api/methods/Walking.java +++ b/src/main/java/org/rev317/min/api/methods/Walking.java @@ -2,8 +2,6 @@ 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; @@ -20,11 +18,9 @@ public class Walking { * @param to Tile to Walk To. */ public static void walkTo(Tile from, Tile to) { - 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 { + if (Context.getInstance().getServerProviderInfo().getServerName().equalsIgnoreCase("pkhonor")) { + Loader.getClient().walkToPKH(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()); } }