From 1b996b9b821988cd95c7745bfaa359a0c5895bae Mon Sep 17 00:00:00 2001 From: Ceikry Date: Mon, 7 Aug 2023 02:28:32 +0000 Subject: [PATCH] Fixed unreachable grand exchange NPC exchange option --- .../core/game/interaction/MovementPulse.java | 26 +++++++++---------- 1 file changed, 12 insertions(+), 14 deletions(-) diff --git a/Server/src/main/core/game/interaction/MovementPulse.java b/Server/src/main/core/game/interaction/MovementPulse.java index 89f05344b..1cb0bd664 100644 --- a/Server/src/main/core/game/interaction/MovementPulse.java +++ b/Server/src/main/core/game/interaction/MovementPulse.java @@ -267,27 +267,25 @@ public abstract class MovementPulse extends Pulse { Location loc = null; - if (destinationFlag != null && overrideMethod == null) { + if (optionHandler != null) { + loc = optionHandler.getDestination(mover, destination); + } + else if (useHandler != null) { + loc = useHandler.getDestination((Player) mover, destination); + } + else if (isInsideEntity(mover.getLocation())) { + loc = findBorderLocation(); + } + + if (loc == null && destinationFlag != null && overrideMethod == null) { loc = destinationFlag.getDestination(mover, destination); } - else if(overrideMethod != null){ + else if(loc == null && overrideMethod != null){ loc = overrideMethod.invoke(mover,destination); if(loc == destination.getLocation() && destinationFlag != null) loc = destinationFlag.getDestination(mover,destination); else if (loc == destination.getLocation()) loc = null; } - if (loc == null) { - if (optionHandler != null) { - loc = optionHandler.getDestination(mover, destination); - } - else if (useHandler != null) { - loc = useHandler.getDestination((Player) mover, destination); - } - else if (isInsideEntity(mover.getLocation())) { - loc = findBorderLocation(); - } - } - if (destination instanceof NPC) loc = checkForEntityPathInterrupt(loc != null ? loc : destination.getLocation());