bank: null check items

This commit is contained in:
Ganom
2019-11-07 02:27:32 -05:00
committed by GitHub
parent c23863ff36
commit 9b959d4bb1

View File

@@ -51,7 +51,14 @@ class ContainerCalculation
ContainerPrices calculate(Item[] items)
{
// Returns last calculation if inventory hasn't changed
if (items == null)
{
return null;
}
final int newHash = hashItems(items);
if (containerPrices != null && hash == newHash)
{
return containerPrices;
@@ -86,7 +93,7 @@ class ContainerCalculation
final long storePrice = itemManager.getItemDefinition(id).getPrice();
final long alchPrice = (long) (storePrice * Constants.HIGH_ALCHEMY_MULTIPLIER);
alch += alchPrice * qty;
ge += itemManager.getItemPrice(id) * qty;
ge += (long) itemManager.getItemPrice(id) * qty;
break;
}