Package l2p.gameserver.clientpackets

Source Code of l2p.gameserver.clientpackets.CannotMoveAnymoreInVehicle

package l2p.gameserver.clientpackets;

import l2p.gameserver.model.L2Player;
import l2p.gameserver.serverpackets.StopMoveToLocationInVehicle;
import l2p.util.Location;

// format: cddddd
public class CannotMoveAnymoreInVehicle extends L2GameClientPacket
{
  private Location _loc = new Location();
  private int _boatid;

  @Override
  public void readImpl()
  {
    _boatid = readD();
    _loc.x = readD();
    _loc.y = readD();
    _loc.z = readD();
    _loc.h = readD();
  }

  @Override
  public void runImpl()
  {
    L2Player activeChar = getClient().getActiveChar();
    if(activeChar == null)
    {
      return;
    }
    if(activeChar.isInVehicle() && activeChar.getVehicle().getObjectId() == _boatid)
    {
      activeChar.setInVehiclePosition(_loc);
      activeChar.setHeading(_loc.h);
      activeChar.broadcastPacket(new StopMoveToLocationInVehicle(activeChar, _boatid));
    }
  }
}
TOP

Related Classes of l2p.gameserver.clientpackets.CannotMoveAnymoreInVehicle

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.