Set last server position when player is restored.

This commit is contained in:
MobiusDev
2018-04-26 03:08:58 +00:00
parent f03fa5db9a
commit 78fd10482f
17 changed files with 75 additions and 9 deletions

View File

@ -6655,7 +6655,11 @@ public final class L2PcInstance extends L2Playable
CursedWeaponsManager.getInstance().checkPlayer(player);
// Set the x,y,z position of the L2PcInstance and make it invisible
player.setXYZInvisible(rset.getInt("x"), rset.getInt("y"), rset.getInt("z"));
final int x = rset.getInt("x");
final int y = rset.getInt("y");
final int z = rset.getInt("z");
player.setXYZInvisible(x, y, z);
player.setLastServerPosition(x, y, z);
// Set Teleport Bookmark Slot
player.setBookMarkSlot(rset.getInt("BookmarkSlot"));

View File

@ -84,6 +84,7 @@ public class MoveBackwardToLocation implements IClientIncomingPacket
if ((_targetX == _originX) && (_targetY == _originY) && (_targetZ == _originZ))
{
activeChar.sendPacket(new StopMove(activeChar));
activeChar.sendPacket(ActionFailed.STATIC_PACKET);
return;
}
@ -91,6 +92,7 @@ public class MoveBackwardToLocation implements IClientIncomingPacket
if (DoorData.getInstance().checkIfDoorsBetween(activeChar.getX(), activeChar.getY(), activeChar.getZ(), _targetX, _targetY, _targetZ, activeChar.getInstanceWorld(), false))
{
activeChar.stopMove(activeChar.getLastServerPosition());
activeChar.sendPacket(ActionFailed.STATIC_PACKET);
return;
}