Browse Source

Add protection in multisell for buy from to far
Reported by: sahar

Zealar 10 years ago
parent
commit
c63433ae82

+ 11 - 0
L2J_Server/java/com/l2jserver/gameserver/network/clientpackets/MultiSellChoose.java

@@ -18,6 +18,8 @@
  */
 package com.l2jserver.gameserver.network.clientpackets;
 
+import static com.l2jserver.gameserver.model.actor.L2Npc.INTERACTION_DISTANCE;
+
 import java.util.ArrayList;
 
 import javolution.util.FastList;
@@ -125,6 +127,15 @@ public class MultiSellChoose extends L2GameClientPacket
 			return;
 		}
 		
+		if (!player.isGM() && (npc != null))
+		{
+			if (!player.isInsideRadius(npc, INTERACTION_DISTANCE, true, false) || (player.getInstanceId() != npc.getInstanceId()))
+			{
+				player.setMultiSell(null);
+				return;
+			}
+		}
+		
 		for (Entry entry : list.getEntries())
 		{
 			if (entry.getEntryId() == _entryId)