Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ### Eclipse Workspace Patch 1.0
- #P L2J_Server
- Index: java/com/l2jserver/gameserver/network/clientpackets/MoveBackwardToLocation.java
- ===================================================================
- --- java/com/l2jserver/gameserver/network/clientpackets/MoveBackwardToLocation.java (revision 4524)
- +++ java/com/l2jserver/gameserver/network/clientpackets/MoveBackwardToLocation.java (working copy)
- @@ -18,6 +18,7 @@
- import com.l2jserver.Config;
- import com.l2jserver.gameserver.TaskPriority;
- +import com.l2jserver.gameserver.ThreadPoolManager;
- import com.l2jserver.gameserver.ai.CtrlIntention;
- import com.l2jserver.gameserver.model.L2CharPosition;
- import com.l2jserver.gameserver.model.actor.instance.L2PcInstance;
- @@ -114,10 +113,13 @@
- if (_moveMovement == 0 && Config.GEODATA < 1) // cursor movement without geodata is disabled
- {
- +
- activeChar.sendPacket(ActionFailed.STATIC_PACKET);
- }
- else
- {
- + if(activeChar.canMove()){
- +
- double dx = _targetX - _curX;
- double dy = _targetY - _curY;
- // Can't move if character is confused, or trying to move a huge distance
- @@ -130,9 +132,28 @@
- /*if (activeChar.getParty() != null)
- activeChar.getParty().broadcastToPartyMembers(activeChar, new PartyMemberPosition(activeChar));*/
- +
- + activeChar.setCanMove(false);
- + ThreadPoolManager.getInstance().scheduleGeneral(new protection(activeChar), 1000);//1 sec
- + }else{
- + activeChar.getAI().setIntention(CtrlIntention.AI_INTENTION_MOVE_TO, new L2CharPosition(activeChar.getX()+1, activeChar.getY()+1, activeChar.getZ()+1, 0));
- + activeChar.sendMessage("You were clicking too fast.");
- + }
- }
- }
- + class protection implements Runnable
- + {
- + L2PcInstance activeChar;
- + public protection(L2PcInstance player){
- + activeChar = player;
- + }
- + @Override
- + public void run()
- + {
- + activeChar.setCanMove(true);
- + }
- + }
- /* (non-Javadoc)
- * @see com.l2jserver.gameserver.clientpackets.ClientBasePacket#getType()
- */
- Index: java/com/l2jserver/gameserver/model/actor/instance/L2PcInstance.java
- ===================================================================
- --- java/com/l2jserver/gameserver/model/actor/instance/L2PcInstance.java (revision 4544)
- +++ java/com/l2jserver/gameserver/model/actor/instance/L2PcInstance.java (working copy)
- @@ -494,6 +494,7 @@
- private int _olympiadGameId = -1;
- private int _olympiadSide = -1;
- public int olyBuff = 0;
- + private boolean _movementAllowed = true;
- /** Duel */
- private boolean _isInDuel = false;
- @@ -15083,4 +15084,11 @@
- // Maintain = 1
- return 0;
- }
- +
- + public void setCanMove(boolean x){
- + _movementAllowed = x;
- + }
- + public boolean canMove(){
- + return _movementAllowed;
- + }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement