summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKHobbits <rob@khobbits.co.uk>2014-02-02 15:02:06 +0000
committerKHobbits <rob@khobbits.co.uk>2014-02-02 15:04:07 +0000
commit889afc80899e44798496a6edc4a622e8ed304424 (patch)
treea37cc28d9636486e7d7468b1e8d5ac40ab4a6a01
parent042f3a210ab8bb087c40647e27206a93ff38a355 (diff)
downloadEssentials-889afc80899e44798496a6edc4a622e8ed304424.tar
Essentials-889afc80899e44798496a6edc4a622e8ed304424.tar.gz
Essentials-889afc80899e44798496a6edc4a622e8ed304424.tar.lz
Essentials-889afc80899e44798496a6edc4a622e8ed304424.tar.xz
Essentials-889afc80899e44798496a6edc4a622e8ed304424.zip
Make sure we leave any vehicles before teleporting.
-rw-r--r--Essentials/src/com/earth2me/essentials/Teleport.java8
1 files changed, 8 insertions, 0 deletions
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);
}
}