Proper RequestNewEnchantTry InventoryUpdate logic.
Contributed by nasseka.
This commit is contained in:
@@ -111,10 +111,6 @@ public class RequestNewEnchantTry implements IClientIncomingPacket
|
||||
return;
|
||||
}
|
||||
|
||||
final InventoryUpdate iu = new InventoryUpdate();
|
||||
iu.addRemovedItem(itemOne);
|
||||
// iu.addRemovedItem(itemTwo);
|
||||
|
||||
if (player.destroyItem("Compound-Item-One", itemOne, 1, null, true) && player.destroyItem("Compound-Item-Two", itemTwo, 1, null, true) && ((combinationItem.getCommission() <= 0) || player.reduceAdena("Compound-Commission", combinationItem.getCommission(), player, true)))
|
||||
{
|
||||
final double random = (Rnd.nextDouble() * 100);
|
||||
@@ -131,7 +127,25 @@ public class RequestNewEnchantTry implements IClientIncomingPacket
|
||||
}
|
||||
}
|
||||
|
||||
final InventoryUpdate iu = new InventoryUpdate();
|
||||
if (itemOne.isStackable() && (itemOne.getCount() > 0))
|
||||
{
|
||||
iu.addModifiedItem(itemOne);
|
||||
}
|
||||
else
|
||||
{
|
||||
iu.addRemovedItem(itemOne);
|
||||
}
|
||||
if (itemTwo.isStackable() && (itemTwo.getCount() > 0))
|
||||
{
|
||||
iu.addModifiedItem(itemTwo);
|
||||
}
|
||||
else
|
||||
{
|
||||
iu.addRemovedItem(itemTwo);
|
||||
}
|
||||
player.sendInventoryUpdate(iu);
|
||||
|
||||
player.removeRequest(request.getClass());
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user