Block key movement when mounting.
This commit is contained in:
@ -248,6 +248,7 @@ public abstract class L2Character extends L2Object implements ISkillsHolder, IDe
|
||||
/** Movement data of this L2Character */
|
||||
protected MoveData _move;
|
||||
private boolean _cursorKeyMovement = false;
|
||||
private boolean _cursorKeyMovementActive = true;
|
||||
|
||||
/** This creature's target. */
|
||||
private L2Object _target;
|
||||
@ -2945,6 +2946,7 @@ public abstract class L2Character extends L2Object implements ISkillsHolder, IDe
|
||||
{
|
||||
_move.onGeodataPathIndex = -1;
|
||||
stopMove(getActingPlayer().getLastServerPosition());
|
||||
_cursorKeyMovementActive = false;
|
||||
return false;
|
||||
}
|
||||
}
|
||||
@ -3172,6 +3174,11 @@ public abstract class L2Character extends L2Object implements ISkillsHolder, IDe
|
||||
double dz = (z - curZ);
|
||||
double distance = Math.hypot(dx, dy);
|
||||
|
||||
if (!_cursorKeyMovementActive && (distance > 200))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
final boolean verticalMovementOnly = _isFlying && (distance == 0) && (dz != 0);
|
||||
if (verticalMovementOnly)
|
||||
{
|
||||
@ -5367,6 +5374,16 @@ public abstract class L2Character extends L2Object implements ISkillsHolder, IDe
|
||||
_cursorKeyMovement = value;
|
||||
}
|
||||
|
||||
public void setCursorKeyMovementActive(boolean value)
|
||||
{
|
||||
_cursorKeyMovementActive = value;
|
||||
}
|
||||
|
||||
public boolean isCursorKeyMovementActive()
|
||||
{
|
||||
return _cursorKeyMovementActive;
|
||||
}
|
||||
|
||||
public List<L2ItemInstance> getFakePlayerDrops()
|
||||
{
|
||||
return _fakePlayerDrops;
|
||||
|
@ -104,6 +104,11 @@ public class MoveBackwardToLocation implements IClientIncomingPacket
|
||||
// Validate position packets sends head level.
|
||||
_targetZ += activeChar.getTemplate().getCollisionHeight();
|
||||
|
||||
if (!activeChar.isCursorKeyMovementActive() && (activeChar.isInFrontOf(new Location(_targetX, _targetY, _targetZ)) || activeChar.isOnSideOf(new Location(_originX, _originY, _originZ))))
|
||||
{
|
||||
activeChar.setCursorKeyMovementActive(true);
|
||||
}
|
||||
|
||||
if (_movementMode == 1)
|
||||
{
|
||||
activeChar.setCursorKeyMovement(false);
|
||||
@ -121,6 +126,10 @@ public class MoveBackwardToLocation implements IClientIncomingPacket
|
||||
return;
|
||||
}
|
||||
activeChar.setCursorKeyMovement(true);
|
||||
if (!activeChar.isCursorKeyMovementActive())
|
||||
{
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
switch (activeChar.getTeleMode())
|
||||
|
Reference in New Issue
Block a user