Minor MultisellChoose changes.

This commit is contained in:
MobiusDev 2016-02-08 11:20:25 +00:00
parent 40173f37f4
commit 09a943f0df

View File

@ -158,8 +158,7 @@ public class MultiSellChoose extends L2GameClientPacket
} }
final ArrayList<Ingredient> ingredientsList = new ArrayList<>(entry.getIngredients().size()); final ArrayList<Ingredient> ingredientsList = new ArrayList<>(entry.getIngredients().size());
// Generate a list of distinct ingredients and counts in order to check if the correct item-counts // Generate a list of distinct ingredients and counts in order to check if the correct item-counts are possessed by the player
// are possessed by the player
boolean newIng; boolean newIng;
for (Ingredient e : entry.getIngredients()) for (Ingredient e : entry.getIngredients())
{ {
@ -193,7 +192,7 @@ public class MultiSellChoose extends L2GameClientPacket
} }
} }
// now check if the player has sufficient items in the inventory to cover the ingredients' expences // now check if the player has sufficient items in the inventory to cover the ingredient expenses
for (Ingredient e : ingredientsList) for (Ingredient e : ingredientsList)
{ {
if ((e.getItemCount() * _amount) > Integer.MAX_VALUE) if ((e.getItemCount() * _amount) > Integer.MAX_VALUE)
@ -268,7 +267,7 @@ public class MultiSellChoose extends L2GameClientPacket
} }
else else
{ {
// for non-stackable items, one of two scenaria are possible: // for non-stackable items, one of two scenarios are possible:
// a) list maintains enchantment: get the instances that exactly match the requested enchantment level // a) list maintains enchantment: get the instances that exactly match the requested enchantment level
// b) list does not maintain enchantment: get the instances with the LOWEST enchantment level // b) list does not maintain enchantment: get the instances with the LOWEST enchantment level
@ -343,7 +342,7 @@ public class MultiSellChoose extends L2GameClientPacket
{ {
for (L2ItemInstance item : inventoryContents) for (L2ItemInstance item : inventoryContents)
{ {
if (item.getEnchantLevel() < itemToTake.getEnchantLevel()) if ((item.getEnchantLevel() < itemToTake.getEnchantLevel()) && (item.getEnchantLevel() >= e.getEnchantLevel()))
{ {
itemToTake = item; itemToTake = item;
// nothing will have enchantment less than 0. If a zero-enchanted // nothing will have enchantment less than 0. If a zero-enchanted