UseItem probable exploit prevention.
Author: Tryskell Source: https://maxcheaters.com/topic/225947-useitem-exploit-fix-duplicate-items-all-l2j-versions/
This commit is contained in:
@ -256,14 +256,15 @@ public final class UseItem implements IClientIncomingPacket
|
||||
{
|
||||
ThreadPool.schedule(() ->
|
||||
{
|
||||
// Removed for preventing retail behavior.
|
||||
// if (activeChar.isAttackingNow()) // If character is still engaged in strike we should not change weapon
|
||||
// {
|
||||
// return;
|
||||
// }
|
||||
// Check if the item is still on inventory.
|
||||
final L2ItemInstance equipItem = activeChar.getInventory().getItemByObjectId(_objectId);
|
||||
if (equipItem == null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
// Equip or unEquip
|
||||
activeChar.useEquippableItem(item, false);
|
||||
// Equip or unEquip.
|
||||
activeChar.useEquippableItem(equipItem, false);
|
||||
}, activeChar.getAttackEndTime() - TimeUnit.MILLISECONDS.toNanos(System.currentTimeMillis()));
|
||||
}
|
||||
else
|
||||
|
Reference in New Issue
Block a user