From 161862bc535ab3a93cbe613522041daee770fbca Mon Sep 17 00:00:00 2001 From: KHobbits Date: Sun, 2 Feb 2014 15:02:06 +0000 Subject: [PATCH] Make sure we leave any vehicles before teleporting. --- Essentials/src/com/earth2me/essentials/Teleport.java | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/Essentials/src/com/earth2me/essentials/Teleport.java b/Essentials/src/com/earth2me/essentials/Teleport.java index 270f7eead..f1d60f9c4 100644 --- a/Essentials/src/com/earth2me/essentials/Teleport.java +++ b/Essentials/src/com/earth2me/essentials/Teleport.java @@ -105,6 +105,10 @@ public class Teleport implements net.ess3.api.ITeleport { if (ess.getSettings().isTeleportSafetyEnabled()) { + if (teleportee.getBase().isInsideVehicle()) + { + teleportee.getBase().leaveVehicle();; + } teleportee.getBase().teleport(LocationUtil.getSafeDestination(teleportee, loc)); } else @@ -114,6 +118,10 @@ public class Teleport implements net.ess3.api.ITeleport } else { + if (teleportee.getBase().isInsideVehicle()) + { + teleportee.getBase().leaveVehicle();; + } teleportee.getBase().teleport(loc); } }