Added some checks on SendWareHouseDepositList and SendWareHouseWithDrawList.
This commit is contained in:
parent
9867c4ee1c
commit
229f7a61a7
@ -25,6 +25,7 @@ import org.l2jmobius.gameserver.model.item.instance.Item;
|
||||
import org.l2jmobius.gameserver.model.item.type.EtcItemType;
|
||||
import org.l2jmobius.gameserver.model.itemcontainer.ClanWarehouse;
|
||||
import org.l2jmobius.gameserver.model.itemcontainer.ItemContainer;
|
||||
import org.l2jmobius.gameserver.model.itemcontainer.PlayerWarehouse;
|
||||
import org.l2jmobius.gameserver.network.GameClient;
|
||||
import org.l2jmobius.gameserver.network.PacketLogger;
|
||||
import org.l2jmobius.gameserver.network.SystemMessageId;
|
||||
@ -227,6 +228,11 @@ public class SendWareHouseDepositList implements IClientIncomingPacket
|
||||
continue;
|
||||
}
|
||||
|
||||
if (!oldItem.isAvailable(player, true, warehouse instanceof PlayerWarehouse))
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
final int itemId = oldItem.getItemId();
|
||||
if (((itemId >= 6611) && (itemId <= 6621)) || (itemId == 6842))
|
||||
{
|
||||
|
@ -33,6 +33,7 @@ import org.l2jmobius.gameserver.network.serverpackets.EnchantResult;
|
||||
import org.l2jmobius.gameserver.network.serverpackets.InventoryUpdate;
|
||||
import org.l2jmobius.gameserver.network.serverpackets.ItemList;
|
||||
import org.l2jmobius.gameserver.network.serverpackets.StatusUpdate;
|
||||
import org.l2jmobius.gameserver.util.Util;
|
||||
|
||||
public class SendWareHouseWithDrawList implements IClientIncomingPacket
|
||||
{
|
||||
@ -138,10 +139,12 @@ public class SendWareHouseWithDrawList implements IClientIncomingPacket
|
||||
|
||||
// Calculate needed slots
|
||||
final Item item = warehouse.getItemByObjectId(objectId);
|
||||
if (item == null)
|
||||
if ((item == null) || (item.getCount() < count))
|
||||
{
|
||||
continue;
|
||||
Util.handleIllegalPlayerAction(player, "Warning!! Character " + player.getName() + " of account " + player.getAccountName() + " tried to withdraw non-existent item from warehouse.", Config.DEFAULT_PUNISH);
|
||||
return;
|
||||
}
|
||||
|
||||
weight += count * item.getItem().getWeight();
|
||||
if (!item.isStackable())
|
||||
{
|
||||
|
@ -26,6 +26,7 @@ import org.l2jmobius.gameserver.model.item.instance.Item;
|
||||
import org.l2jmobius.gameserver.model.item.type.EtcItemType;
|
||||
import org.l2jmobius.gameserver.model.itemcontainer.ClanWarehouse;
|
||||
import org.l2jmobius.gameserver.model.itemcontainer.ItemContainer;
|
||||
import org.l2jmobius.gameserver.model.itemcontainer.PlayerWarehouse;
|
||||
import org.l2jmobius.gameserver.network.GameClient;
|
||||
import org.l2jmobius.gameserver.network.PacketLogger;
|
||||
import org.l2jmobius.gameserver.network.SystemMessageId;
|
||||
@ -228,6 +229,11 @@ public class SendWareHouseDepositList implements IClientIncomingPacket
|
||||
continue;
|
||||
}
|
||||
|
||||
if (!oldItem.isAvailable(player, true, warehouse instanceof PlayerWarehouse))
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
final int itemId = oldItem.getItemId();
|
||||
if (((itemId >= 6611) && (itemId <= 6621)) || (itemId == 6842))
|
||||
{
|
||||
|
@ -33,6 +33,7 @@ import org.l2jmobius.gameserver.network.serverpackets.EnchantResult;
|
||||
import org.l2jmobius.gameserver.network.serverpackets.InventoryUpdate;
|
||||
import org.l2jmobius.gameserver.network.serverpackets.ItemList;
|
||||
import org.l2jmobius.gameserver.network.serverpackets.StatusUpdate;
|
||||
import org.l2jmobius.gameserver.util.Util;
|
||||
|
||||
public class SendWareHouseWithDrawList implements IClientIncomingPacket
|
||||
{
|
||||
@ -138,10 +139,12 @@ public class SendWareHouseWithDrawList implements IClientIncomingPacket
|
||||
|
||||
// Calculate needed slots
|
||||
final Item item = warehouse.getItemByObjectId(objectId);
|
||||
if (item == null)
|
||||
if ((item == null) || (item.getCount() < count))
|
||||
{
|
||||
continue;
|
||||
Util.handleIllegalPlayerAction(player, "Warning!! Character " + player.getName() + " of account " + player.getAccountName() + " tried to withdraw non-existent item from warehouse.", Config.DEFAULT_PUNISH);
|
||||
return;
|
||||
}
|
||||
|
||||
weight += count * item.getItem().getWeight();
|
||||
if (!item.isStackable())
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user