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 59bc3043f4..6081c7c7d3 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 @@ -245,6 +245,7 @@ public abstract class L2Character extends L2Object implements ISkillsHolder, IDe /** Movement data of this L2Character */ protected MoveData _move; + private boolean _cursorKeyMovement = false; /** This creature's target. */ private L2Object _target; @@ -3494,7 +3495,7 @@ public abstract class L2Character extends L2Object implements ISkillsHolder, IDe m.onGeodataPathIndex = -1; // Initialize not on geodata path m.disregardingGeodata = false; - if (!isFlying() && !isInsideZone(ZoneId.WATER) && !isVehicle()) + if (!isFlying() && !isInsideZone(ZoneId.WATER) && !isVehicle() && !_cursorKeyMovement) { final boolean isInVehicle = isPlayer() && (getActingPlayer().getVehicle() != null); if (isInVehicle) @@ -5543,4 +5544,9 @@ public abstract class L2Character extends L2Object implements ISkillsHolder, IDe { return calculateDistance(target, true, false); } + + public void setCursorKeyMovement(boolean value) + { + _cursorKeyMovement = value; + } } diff --git a/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/network/clientpackets/MoveBackwardToLocation.java b/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/network/clientpackets/MoveBackwardToLocation.java index b9f7204d84..24c1906d50 100644 --- a/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/network/clientpackets/MoveBackwardToLocation.java +++ b/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/network/clientpackets/MoveBackwardToLocation.java @@ -41,26 +41,15 @@ import com.l2jmobius.gameserver.network.serverpackets.sayune.ExFlyMove; import com.l2jmobius.gameserver.network.serverpackets.sayune.ExFlyMoveBroadcast; import com.l2jmobius.gameserver.util.Broadcast; -/** - * This class ... - * @version $Revision: 1.11.2.4.2.4 $ $Date: 2005/03/27 15:29:30 $ - */ public class MoveBackwardToLocation implements IClientIncomingPacket { - // cdddddd private int _targetX; private int _targetY; private int _targetZ; private int _originX; private int _originY; private int _originZ; - private int _moveMovement; - - // For geodata - private int _curX; - private int _curY; - @SuppressWarnings("unused") - private int _curZ; + private int _movementMode; @Override public boolean read(L2GameClient client, PacketReader packet) @@ -71,7 +60,7 @@ public class MoveBackwardToLocation implements IClientIncomingPacket _originX = packet.readD(); _originY = packet.readD(); _originZ = packet.readD(); - _moveMovement = packet.readD(); // is 0 if cursor keys are used 1 if mouse is used + _movementMode = packet.readD(); // is 0 if cursor keys are used 1 if mouse is used return true; } @@ -105,8 +94,9 @@ public class MoveBackwardToLocation implements IClientIncomingPacket // Validate position packets sends head level. _targetZ += activeChar.getTemplate().getCollisionHeight(); - if (_moveMovement == 1) + if (_movementMode == 1) { + activeChar.setCursorKeyMovement(false); final TerminateReturn terminate = EventDispatcher.getInstance().notifyEvent(new OnPlayerMoveRequest(activeChar, new Location(_targetX, _targetY, _targetZ)), activeChar, TerminateReturn.class); if ((terminate != null) && terminate.terminate()) { @@ -114,10 +104,10 @@ public class MoveBackwardToLocation implements IClientIncomingPacket return; } } - - _curX = activeChar.getX(); - _curY = activeChar.getY(); - _curZ = activeChar.getZ(); + else // 0 + { + activeChar.setCursorKeyMovement(true); + } switch (activeChar.getTeleMode()) { @@ -147,8 +137,8 @@ public class MoveBackwardToLocation implements IClientIncomingPacket } default: { - final double dx = _targetX - _curX; - final double dy = _targetY - _curY; + final double dx = _targetX - activeChar.getX(); + final double dy = _targetY - activeChar.getY(); // Can't move if character is confused, or trying to move a huge distance if (activeChar.isControlBlocked() || (((dx * dx) + (dy * dy)) > 98010000)) // 9900*9900 { 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 8fca95e972..05c87d5a3e 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 @@ -246,6 +246,7 @@ public abstract class L2Character extends L2Object implements ISkillsHolder, IDe /** Movement data of this L2Character */ protected MoveData _move; + private boolean _cursorKeyMovement = false; /** This creature's target. */ private L2Object _target; @@ -3498,7 +3499,7 @@ public abstract class L2Character extends L2Object implements ISkillsHolder, IDe m.onGeodataPathIndex = -1; // Initialize not on geodata path m.disregardingGeodata = false; - if (!isFlying() && !isInsideZone(ZoneId.WATER) && !isVehicle()) + if (!isFlying() && !isInsideZone(ZoneId.WATER) && !isVehicle() && !_cursorKeyMovement) { final boolean isInVehicle = isPlayer() && (getActingPlayer().getVehicle() != null); if (isInVehicle) @@ -5580,4 +5581,9 @@ public abstract class L2Character extends L2Object implements ISkillsHolder, IDe { // Dummy method to be overriden. } + + public void setCursorKeyMovement(boolean value) + { + _cursorKeyMovement = value; + } } diff --git a/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/network/clientpackets/MoveBackwardToLocation.java b/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/network/clientpackets/MoveBackwardToLocation.java index b9f7204d84..24c1906d50 100644 --- a/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/network/clientpackets/MoveBackwardToLocation.java +++ b/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/network/clientpackets/MoveBackwardToLocation.java @@ -41,26 +41,15 @@ import com.l2jmobius.gameserver.network.serverpackets.sayune.ExFlyMove; import com.l2jmobius.gameserver.network.serverpackets.sayune.ExFlyMoveBroadcast; import com.l2jmobius.gameserver.util.Broadcast; -/** - * This class ... - * @version $Revision: 1.11.2.4.2.4 $ $Date: 2005/03/27 15:29:30 $ - */ public class MoveBackwardToLocation implements IClientIncomingPacket { - // cdddddd private int _targetX; private int _targetY; private int _targetZ; private int _originX; private int _originY; private int _originZ; - private int _moveMovement; - - // For geodata - private int _curX; - private int _curY; - @SuppressWarnings("unused") - private int _curZ; + private int _movementMode; @Override public boolean read(L2GameClient client, PacketReader packet) @@ -71,7 +60,7 @@ public class MoveBackwardToLocation implements IClientIncomingPacket _originX = packet.readD(); _originY = packet.readD(); _originZ = packet.readD(); - _moveMovement = packet.readD(); // is 0 if cursor keys are used 1 if mouse is used + _movementMode = packet.readD(); // is 0 if cursor keys are used 1 if mouse is used return true; } @@ -105,8 +94,9 @@ public class MoveBackwardToLocation implements IClientIncomingPacket // Validate position packets sends head level. _targetZ += activeChar.getTemplate().getCollisionHeight(); - if (_moveMovement == 1) + if (_movementMode == 1) { + activeChar.setCursorKeyMovement(false); final TerminateReturn terminate = EventDispatcher.getInstance().notifyEvent(new OnPlayerMoveRequest(activeChar, new Location(_targetX, _targetY, _targetZ)), activeChar, TerminateReturn.class); if ((terminate != null) && terminate.terminate()) { @@ -114,10 +104,10 @@ public class MoveBackwardToLocation implements IClientIncomingPacket return; } } - - _curX = activeChar.getX(); - _curY = activeChar.getY(); - _curZ = activeChar.getZ(); + else // 0 + { + activeChar.setCursorKeyMovement(true); + } switch (activeChar.getTeleMode()) { @@ -147,8 +137,8 @@ public class MoveBackwardToLocation implements IClientIncomingPacket } default: { - final double dx = _targetX - _curX; - final double dy = _targetY - _curY; + final double dx = _targetX - activeChar.getX(); + final double dy = _targetY - activeChar.getY(); // Can't move if character is confused, or trying to move a huge distance if (activeChar.isControlBlocked() || (((dx * dx) + (dy * dy)) > 98010000)) // 9900*9900 { 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 8fca95e972..05c87d5a3e 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 @@ -246,6 +246,7 @@ public abstract class L2Character extends L2Object implements ISkillsHolder, IDe /** Movement data of this L2Character */ protected MoveData _move; + private boolean _cursorKeyMovement = false; /** This creature's target. */ private L2Object _target; @@ -3498,7 +3499,7 @@ public abstract class L2Character extends L2Object implements ISkillsHolder, IDe m.onGeodataPathIndex = -1; // Initialize not on geodata path m.disregardingGeodata = false; - if (!isFlying() && !isInsideZone(ZoneId.WATER) && !isVehicle()) + if (!isFlying() && !isInsideZone(ZoneId.WATER) && !isVehicle() && !_cursorKeyMovement) { final boolean isInVehicle = isPlayer() && (getActingPlayer().getVehicle() != null); if (isInVehicle) @@ -5580,4 +5581,9 @@ public abstract class L2Character extends L2Object implements ISkillsHolder, IDe { // Dummy method to be overriden. } + + public void setCursorKeyMovement(boolean value) + { + _cursorKeyMovement = value; + } } diff --git a/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/network/clientpackets/MoveBackwardToLocation.java b/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/network/clientpackets/MoveBackwardToLocation.java index b9f7204d84..24c1906d50 100644 --- a/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/network/clientpackets/MoveBackwardToLocation.java +++ b/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/network/clientpackets/MoveBackwardToLocation.java @@ -41,26 +41,15 @@ import com.l2jmobius.gameserver.network.serverpackets.sayune.ExFlyMove; import com.l2jmobius.gameserver.network.serverpackets.sayune.ExFlyMoveBroadcast; import com.l2jmobius.gameserver.util.Broadcast; -/** - * This class ... - * @version $Revision: 1.11.2.4.2.4 $ $Date: 2005/03/27 15:29:30 $ - */ public class MoveBackwardToLocation implements IClientIncomingPacket { - // cdddddd private int _targetX; private int _targetY; private int _targetZ; private int _originX; private int _originY; private int _originZ; - private int _moveMovement; - - // For geodata - private int _curX; - private int _curY; - @SuppressWarnings("unused") - private int _curZ; + private int _movementMode; @Override public boolean read(L2GameClient client, PacketReader packet) @@ -71,7 +60,7 @@ public class MoveBackwardToLocation implements IClientIncomingPacket _originX = packet.readD(); _originY = packet.readD(); _originZ = packet.readD(); - _moveMovement = packet.readD(); // is 0 if cursor keys are used 1 if mouse is used + _movementMode = packet.readD(); // is 0 if cursor keys are used 1 if mouse is used return true; } @@ -105,8 +94,9 @@ public class MoveBackwardToLocation implements IClientIncomingPacket // Validate position packets sends head level. _targetZ += activeChar.getTemplate().getCollisionHeight(); - if (_moveMovement == 1) + if (_movementMode == 1) { + activeChar.setCursorKeyMovement(false); final TerminateReturn terminate = EventDispatcher.getInstance().notifyEvent(new OnPlayerMoveRequest(activeChar, new Location(_targetX, _targetY, _targetZ)), activeChar, TerminateReturn.class); if ((terminate != null) && terminate.terminate()) { @@ -114,10 +104,10 @@ public class MoveBackwardToLocation implements IClientIncomingPacket return; } } - - _curX = activeChar.getX(); - _curY = activeChar.getY(); - _curZ = activeChar.getZ(); + else // 0 + { + activeChar.setCursorKeyMovement(true); + } switch (activeChar.getTeleMode()) { @@ -147,8 +137,8 @@ public class MoveBackwardToLocation implements IClientIncomingPacket } default: { - final double dx = _targetX - _curX; - final double dy = _targetY - _curY; + final double dx = _targetX - activeChar.getX(); + final double dy = _targetY - activeChar.getY(); // Can't move if character is confused, or trying to move a huge distance if (activeChar.isControlBlocked() || (((dx * dx) + (dy * dy)) > 98010000)) // 9900*9900 { 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 8fca95e972..05c87d5a3e 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 @@ -246,6 +246,7 @@ public abstract class L2Character extends L2Object implements ISkillsHolder, IDe /** Movement data of this L2Character */ protected MoveData _move; + private boolean _cursorKeyMovement = false; /** This creature's target. */ private L2Object _target; @@ -3498,7 +3499,7 @@ public abstract class L2Character extends L2Object implements ISkillsHolder, IDe m.onGeodataPathIndex = -1; // Initialize not on geodata path m.disregardingGeodata = false; - if (!isFlying() && !isInsideZone(ZoneId.WATER) && !isVehicle()) + if (!isFlying() && !isInsideZone(ZoneId.WATER) && !isVehicle() && !_cursorKeyMovement) { final boolean isInVehicle = isPlayer() && (getActingPlayer().getVehicle() != null); if (isInVehicle) @@ -5580,4 +5581,9 @@ public abstract class L2Character extends L2Object implements ISkillsHolder, IDe { // Dummy method to be overriden. } + + public void setCursorKeyMovement(boolean value) + { + _cursorKeyMovement = value; + } } diff --git a/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/gameserver/network/clientpackets/MoveBackwardToLocation.java b/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/gameserver/network/clientpackets/MoveBackwardToLocation.java index b9f7204d84..24c1906d50 100644 --- a/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/gameserver/network/clientpackets/MoveBackwardToLocation.java +++ b/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/gameserver/network/clientpackets/MoveBackwardToLocation.java @@ -41,26 +41,15 @@ import com.l2jmobius.gameserver.network.serverpackets.sayune.ExFlyMove; import com.l2jmobius.gameserver.network.serverpackets.sayune.ExFlyMoveBroadcast; import com.l2jmobius.gameserver.util.Broadcast; -/** - * This class ... - * @version $Revision: 1.11.2.4.2.4 $ $Date: 2005/03/27 15:29:30 $ - */ public class MoveBackwardToLocation implements IClientIncomingPacket { - // cdddddd private int _targetX; private int _targetY; private int _targetZ; private int _originX; private int _originY; private int _originZ; - private int _moveMovement; - - // For geodata - private int _curX; - private int _curY; - @SuppressWarnings("unused") - private int _curZ; + private int _movementMode; @Override public boolean read(L2GameClient client, PacketReader packet) @@ -71,7 +60,7 @@ public class MoveBackwardToLocation implements IClientIncomingPacket _originX = packet.readD(); _originY = packet.readD(); _originZ = packet.readD(); - _moveMovement = packet.readD(); // is 0 if cursor keys are used 1 if mouse is used + _movementMode = packet.readD(); // is 0 if cursor keys are used 1 if mouse is used return true; } @@ -105,8 +94,9 @@ public class MoveBackwardToLocation implements IClientIncomingPacket // Validate position packets sends head level. _targetZ += activeChar.getTemplate().getCollisionHeight(); - if (_moveMovement == 1) + if (_movementMode == 1) { + activeChar.setCursorKeyMovement(false); final TerminateReturn terminate = EventDispatcher.getInstance().notifyEvent(new OnPlayerMoveRequest(activeChar, new Location(_targetX, _targetY, _targetZ)), activeChar, TerminateReturn.class); if ((terminate != null) && terminate.terminate()) { @@ -114,10 +104,10 @@ public class MoveBackwardToLocation implements IClientIncomingPacket return; } } - - _curX = activeChar.getX(); - _curY = activeChar.getY(); - _curZ = activeChar.getZ(); + else // 0 + { + activeChar.setCursorKeyMovement(true); + } switch (activeChar.getTeleMode()) { @@ -147,8 +137,8 @@ public class MoveBackwardToLocation implements IClientIncomingPacket } default: { - final double dx = _targetX - _curX; - final double dy = _targetY - _curY; + final double dx = _targetX - activeChar.getX(); + final double dy = _targetY - activeChar.getY(); // Can't move if character is confused, or trying to move a huge distance if (activeChar.isControlBlocked() || (((dx * dx) + (dy * dy)) > 98010000)) // 9900*9900 { 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 329e37ba9c..e0c74bc711 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 @@ -249,6 +249,7 @@ public abstract class L2Character extends L2Object implements ISkillsHolder, IDe /** Movement data of this L2Character */ protected MoveData _move; + private boolean _cursorKeyMovement = false; /** This creature's target. */ private L2Object _target; @@ -4389,7 +4390,7 @@ public abstract class L2Character extends L2Object implements ISkillsHolder, IDe m.onGeodataPathIndex = -1; // Initialize not on geodata path m.disregardingGeodata = false; - if (!isFlying() && !isInsideZone(ZoneId.WATER) && !isVehicle()) + if (!isFlying() && !isInsideZone(ZoneId.WATER) && !isVehicle() && !_cursorKeyMovement) { final boolean isInVehicle = isPlayer() && (getActingPlayer().getVehicle() != null); if (isInVehicle) @@ -6879,4 +6880,9 @@ public abstract class L2Character extends L2Object implements ISkillsHolder, IDe { return 0; } + + public void setCursorKeyMovement(boolean value) + { + _cursorKeyMovement = value; + } } diff --git a/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/gameserver/network/clientpackets/MoveBackwardToLocation.java b/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/gameserver/network/clientpackets/MoveBackwardToLocation.java index 8868165a8f..d5ec6d3be2 100644 --- a/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/gameserver/network/clientpackets/MoveBackwardToLocation.java +++ b/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/gameserver/network/clientpackets/MoveBackwardToLocation.java @@ -30,23 +30,17 @@ import com.l2jmobius.gameserver.network.serverpackets.ActionFailed; import com.l2jmobius.gameserver.network.serverpackets.StopMove; import com.l2jmobius.gameserver.util.Util; -/** - * This class ... - * @version $Revision: 1.11.2.4.2.4 $ $Date: 2005/03/27 15:29:30 $ - */ public class MoveBackwardToLocation extends L2GameClientPacket { private static final String _C__0F_MOVEBACKWARDTOLOC = "[C] 0F MoveBackwardToLoc"; - // cdddddd private int _targetX; private int _targetY; private int _targetZ; private int _originX; private int _originY; private int _originZ; - - private int _moveMovement; + private int _movementMode; @Override protected void readImpl() @@ -59,7 +53,7 @@ public class MoveBackwardToLocation extends L2GameClientPacket _originZ = readD(); try { - _moveMovement = readD(); // is 0 if cursor keys are used 1 if mouse is used + _movementMode = readD(); // is 0 if cursor keys are used 1 if mouse is used } catch (BufferUnderflowException e) { @@ -101,8 +95,9 @@ public class MoveBackwardToLocation extends L2GameClientPacket // Validate position packets sends head level. _targetZ += activeChar.getTemplate().getCollisionHeight(); - if (_moveMovement == 1) + if (_movementMode == 1) { + activeChar.setCursorKeyMovement(false); final TerminateReturn terminate = EventDispatcher.getInstance().notifyEvent(new OnPlayerMoveRequest(activeChar, new Location(_targetX, _targetY, _targetZ)), activeChar, TerminateReturn.class); if ((terminate != null) && terminate.terminate()) { @@ -110,6 +105,10 @@ public class MoveBackwardToLocation extends L2GameClientPacket return; } } + else // 0 + { + activeChar.setCursorKeyMovement(true); + } if (activeChar.getTeleMode() > 0) { 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 8fca95e972..05c87d5a3e 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 @@ -246,6 +246,7 @@ public abstract class L2Character extends L2Object implements ISkillsHolder, IDe /** Movement data of this L2Character */ protected MoveData _move; + private boolean _cursorKeyMovement = false; /** This creature's target. */ private L2Object _target; @@ -3498,7 +3499,7 @@ public abstract class L2Character extends L2Object implements ISkillsHolder, IDe m.onGeodataPathIndex = -1; // Initialize not on geodata path m.disregardingGeodata = false; - if (!isFlying() && !isInsideZone(ZoneId.WATER) && !isVehicle()) + if (!isFlying() && !isInsideZone(ZoneId.WATER) && !isVehicle() && !_cursorKeyMovement) { final boolean isInVehicle = isPlayer() && (getActingPlayer().getVehicle() != null); if (isInVehicle) @@ -5580,4 +5581,9 @@ public abstract class L2Character extends L2Object implements ISkillsHolder, IDe { // Dummy method to be overriden. } + + public void setCursorKeyMovement(boolean value) + { + _cursorKeyMovement = value; + } } diff --git a/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/network/clientpackets/MoveBackwardToLocation.java b/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/network/clientpackets/MoveBackwardToLocation.java index b9f7204d84..24c1906d50 100644 --- a/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/network/clientpackets/MoveBackwardToLocation.java +++ b/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/network/clientpackets/MoveBackwardToLocation.java @@ -41,26 +41,15 @@ import com.l2jmobius.gameserver.network.serverpackets.sayune.ExFlyMove; import com.l2jmobius.gameserver.network.serverpackets.sayune.ExFlyMoveBroadcast; import com.l2jmobius.gameserver.util.Broadcast; -/** - * This class ... - * @version $Revision: 1.11.2.4.2.4 $ $Date: 2005/03/27 15:29:30 $ - */ public class MoveBackwardToLocation implements IClientIncomingPacket { - // cdddddd private int _targetX; private int _targetY; private int _targetZ; private int _originX; private int _originY; private int _originZ; - private int _moveMovement; - - // For geodata - private int _curX; - private int _curY; - @SuppressWarnings("unused") - private int _curZ; + private int _movementMode; @Override public boolean read(L2GameClient client, PacketReader packet) @@ -71,7 +60,7 @@ public class MoveBackwardToLocation implements IClientIncomingPacket _originX = packet.readD(); _originY = packet.readD(); _originZ = packet.readD(); - _moveMovement = packet.readD(); // is 0 if cursor keys are used 1 if mouse is used + _movementMode = packet.readD(); // is 0 if cursor keys are used 1 if mouse is used return true; } @@ -105,8 +94,9 @@ public class MoveBackwardToLocation implements IClientIncomingPacket // Validate position packets sends head level. _targetZ += activeChar.getTemplate().getCollisionHeight(); - if (_moveMovement == 1) + if (_movementMode == 1) { + activeChar.setCursorKeyMovement(false); final TerminateReturn terminate = EventDispatcher.getInstance().notifyEvent(new OnPlayerMoveRequest(activeChar, new Location(_targetX, _targetY, _targetZ)), activeChar, TerminateReturn.class); if ((terminate != null) && terminate.terminate()) { @@ -114,10 +104,10 @@ public class MoveBackwardToLocation implements IClientIncomingPacket return; } } - - _curX = activeChar.getX(); - _curY = activeChar.getY(); - _curZ = activeChar.getZ(); + else // 0 + { + activeChar.setCursorKeyMovement(true); + } switch (activeChar.getTeleMode()) { @@ -147,8 +137,8 @@ public class MoveBackwardToLocation implements IClientIncomingPacket } default: { - final double dx = _targetX - _curX; - final double dy = _targetY - _curY; + final double dx = _targetX - activeChar.getX(); + final double dy = _targetY - activeChar.getY(); // Can't move if character is confused, or trying to move a huge distance if (activeChar.isControlBlocked() || (((dx * dx) + (dy * dy)) > 98010000)) // 9900*9900 {