Block key movement when mounting.

This commit is contained in:
MobiusDev
2018-11-29 20:04:43 +00:00
parent b2f0b7978e
commit d814997976
27 changed files with 413 additions and 122 deletions

View File

@ -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;

View File

@ -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())