From ad7fef7d49ab3c954526cd8b462eefed0af94aee Mon Sep 17 00:00:00 2001 From: MobiusDev <8391001+MobiusDevelopment@users.noreply.github.com> Date: Tue, 23 Jan 2018 09:36:38 +0000 Subject: [PATCH] Smoother movement when exiting vehicle. --- .../gameserver/model/actor/L2Character.java | 21 +++++++++++-------- .../gameserver/model/actor/L2Character.java | 21 +++++++++++-------- .../gameserver/model/actor/L2Character.java | 21 +++++++++++-------- .../gameserver/model/actor/L2Character.java | 21 +++++++++++-------- .../gameserver/model/actor/L2Character.java | 21 +++++++++++-------- .../gameserver/model/actor/L2Character.java | 21 +++++++++++-------- 6 files changed, 72 insertions(+), 54 deletions(-) diff --git a/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/model/actor/L2Character.java b/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/model/actor/L2Character.java index deb1701ba3..9fe3e3c542 100644 --- a/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/model/actor/L2Character.java +++ b/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/model/actor/L2Character.java @@ -3294,15 +3294,18 @@ public abstract class L2Character extends L2Object implements ISkillsHolder, IDe return; } - // location different if destination wasn't reached (or just z coord is different) - final Location destiny = GeoEngine.getInstance().canMoveToTargetLoc(curX, curY, curZ, x, y, z, getInstanceWorld()); - x = destiny.getX(); - y = destiny.getY(); - z = destiny.getZ(); - dx = x - curX; - dy = y - curY; - dz = z - curZ; - distance = verticalMovementOnly ? Math.pow(dz, 2) : Math.hypot(dx, dy); + if (!isInVehicle) + { + // location different if destination wasn't reached (or just z coord is different) + final Location destiny = GeoEngine.getInstance().canMoveToTargetLoc(curX, curY, curZ, x, y, z, getInstanceWorld()); + x = destiny.getX(); + y = destiny.getY(); + z = destiny.getZ(); + dx = x - curX; + dy = y - curY; + dz = z - curZ; + distance = verticalMovementOnly ? Math.pow(dz, 2) : Math.hypot(dx, dy); + } // Pathfinding checks. if (((originalDistance - distance) > 30) && !isControlBlocked() && !isInVehicle) diff --git a/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/model/actor/L2Character.java b/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/model/actor/L2Character.java index deb1701ba3..9fe3e3c542 100644 --- a/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/model/actor/L2Character.java +++ b/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/model/actor/L2Character.java @@ -3294,15 +3294,18 @@ public abstract class L2Character extends L2Object implements ISkillsHolder, IDe return; } - // location different if destination wasn't reached (or just z coord is different) - final Location destiny = GeoEngine.getInstance().canMoveToTargetLoc(curX, curY, curZ, x, y, z, getInstanceWorld()); - x = destiny.getX(); - y = destiny.getY(); - z = destiny.getZ(); - dx = x - curX; - dy = y - curY; - dz = z - curZ; - distance = verticalMovementOnly ? Math.pow(dz, 2) : Math.hypot(dx, dy); + if (!isInVehicle) + { + // location different if destination wasn't reached (or just z coord is different) + final Location destiny = GeoEngine.getInstance().canMoveToTargetLoc(curX, curY, curZ, x, y, z, getInstanceWorld()); + x = destiny.getX(); + y = destiny.getY(); + z = destiny.getZ(); + dx = x - curX; + dy = y - curY; + dz = z - curZ; + distance = verticalMovementOnly ? Math.pow(dz, 2) : Math.hypot(dx, dy); + } // Pathfinding checks. if (((originalDistance - distance) > 30) && !isControlBlocked() && !isInVehicle) diff --git a/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/model/actor/L2Character.java b/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/model/actor/L2Character.java index deb1701ba3..9fe3e3c542 100644 --- a/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/model/actor/L2Character.java +++ b/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/model/actor/L2Character.java @@ -3294,15 +3294,18 @@ public abstract class L2Character extends L2Object implements ISkillsHolder, IDe return; } - // location different if destination wasn't reached (or just z coord is different) - final Location destiny = GeoEngine.getInstance().canMoveToTargetLoc(curX, curY, curZ, x, y, z, getInstanceWorld()); - x = destiny.getX(); - y = destiny.getY(); - z = destiny.getZ(); - dx = x - curX; - dy = y - curY; - dz = z - curZ; - distance = verticalMovementOnly ? Math.pow(dz, 2) : Math.hypot(dx, dy); + if (!isInVehicle) + { + // location different if destination wasn't reached (or just z coord is different) + final Location destiny = GeoEngine.getInstance().canMoveToTargetLoc(curX, curY, curZ, x, y, z, getInstanceWorld()); + x = destiny.getX(); + y = destiny.getY(); + z = destiny.getZ(); + dx = x - curX; + dy = y - curY; + dz = z - curZ; + distance = verticalMovementOnly ? Math.pow(dz, 2) : Math.hypot(dx, dy); + } // Pathfinding checks. if (((originalDistance - distance) > 30) && !isControlBlocked() && !isInVehicle) diff --git a/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/gameserver/model/actor/L2Character.java b/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/gameserver/model/actor/L2Character.java index deb1701ba3..9fe3e3c542 100644 --- a/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/gameserver/model/actor/L2Character.java +++ b/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/gameserver/model/actor/L2Character.java @@ -3294,15 +3294,18 @@ public abstract class L2Character extends L2Object implements ISkillsHolder, IDe return; } - // location different if destination wasn't reached (or just z coord is different) - final Location destiny = GeoEngine.getInstance().canMoveToTargetLoc(curX, curY, curZ, x, y, z, getInstanceWorld()); - x = destiny.getX(); - y = destiny.getY(); - z = destiny.getZ(); - dx = x - curX; - dy = y - curY; - dz = z - curZ; - distance = verticalMovementOnly ? Math.pow(dz, 2) : Math.hypot(dx, dy); + if (!isInVehicle) + { + // location different if destination wasn't reached (or just z coord is different) + final Location destiny = GeoEngine.getInstance().canMoveToTargetLoc(curX, curY, curZ, x, y, z, getInstanceWorld()); + x = destiny.getX(); + y = destiny.getY(); + z = destiny.getZ(); + dx = x - curX; + dy = y - curY; + dz = z - curZ; + distance = verticalMovementOnly ? Math.pow(dz, 2) : Math.hypot(dx, dy); + } // Pathfinding checks. if (((originalDistance - distance) > 30) && !isControlBlocked() && !isInVehicle) diff --git a/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/gameserver/model/actor/L2Character.java b/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/gameserver/model/actor/L2Character.java index 923a572dc0..f4fcd0521e 100644 --- a/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/gameserver/model/actor/L2Character.java +++ b/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/gameserver/model/actor/L2Character.java @@ -4398,15 +4398,18 @@ public abstract class L2Character extends L2Object implements ISkillsHolder, IDe return; } - // location different if destination wasn't reached (or just z coord is different) - final Location destiny = GeoEngine.getInstance().canMoveToTargetLoc(curX, curY, curZ, x, y, z, getInstanceId()); - x = destiny.getX(); - y = destiny.getY(); - z = destiny.getZ(); - dx = x - curX; - dy = y - curY; - dz = z - curZ; - distance = verticalMovementOnly ? Math.pow(dz, 2) : Math.hypot(dx, dy); + if (!isInVehicle) + { + // location different if destination wasn't reached (or just z coord is different) + final Location destiny = GeoEngine.getInstance().canMoveToTargetLoc(curX, curY, curZ, x, y, z, getInstanceId()); + x = destiny.getX(); + y = destiny.getY(); + z = destiny.getZ(); + dx = x - curX; + dy = y - curY; + dz = z - curZ; + distance = verticalMovementOnly ? Math.pow(dz, 2) : Math.hypot(dx, dy); + } // Pathfinding checks. if (((originalDistance - distance) > 30) && !isAfraid() && !isInVehicle) diff --git a/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/model/actor/L2Character.java b/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/model/actor/L2Character.java index deb1701ba3..9fe3e3c542 100644 --- a/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/model/actor/L2Character.java +++ b/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/model/actor/L2Character.java @@ -3294,15 +3294,18 @@ public abstract class L2Character extends L2Object implements ISkillsHolder, IDe return; } - // location different if destination wasn't reached (or just z coord is different) - final Location destiny = GeoEngine.getInstance().canMoveToTargetLoc(curX, curY, curZ, x, y, z, getInstanceWorld()); - x = destiny.getX(); - y = destiny.getY(); - z = destiny.getZ(); - dx = x - curX; - dy = y - curY; - dz = z - curZ; - distance = verticalMovementOnly ? Math.pow(dz, 2) : Math.hypot(dx, dy); + if (!isInVehicle) + { + // location different if destination wasn't reached (or just z coord is different) + final Location destiny = GeoEngine.getInstance().canMoveToTargetLoc(curX, curY, curZ, x, y, z, getInstanceWorld()); + x = destiny.getX(); + y = destiny.getY(); + z = destiny.getZ(); + dx = x - curX; + dy = y - curY; + dz = z - curZ; + distance = verticalMovementOnly ? Math.pow(dz, 2) : Math.hypot(dx, dy); + } // Pathfinding checks. if (((originalDistance - distance) > 30) && !isControlBlocked() && !isInVehicle)