ammo: fix the infobox not getting removed
This commit is contained in:
@@ -110,6 +110,7 @@ public class AmmoPlugin extends Plugin
|
||||
|
||||
if (items.length <= EquipmentInventorySlot.AMMO.getSlotIdx())
|
||||
{
|
||||
removeInfobox();
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -118,8 +119,7 @@ public class AmmoPlugin extends Plugin
|
||||
|
||||
if (!comp.isStackable())
|
||||
{
|
||||
infoBoxManager.removeInfoBox(counterBox);
|
||||
counterBox = null;
|
||||
removeInfobox();
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -134,9 +134,15 @@ public class AmmoPlugin extends Plugin
|
||||
return;
|
||||
}
|
||||
|
||||
infoBoxManager.removeInfoBox(counterBox);
|
||||
removeInfobox();
|
||||
final BufferedImage image = itemManager.getImage(item.getId(), 5, false);
|
||||
counterBox = new AmmoCounter(this, item.getId(), item.getQuantity(), comp.getName(), image);
|
||||
infoBoxManager.addInfoBox(counterBox);
|
||||
}
|
||||
|
||||
private void removeInfobox()
|
||||
{
|
||||
infoBoxManager.removeInfoBox(counterBox);
|
||||
counterBox = null;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user