Merge pull request #8639 from Hydrox6/ammo3
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())
|
if (items.length <= EquipmentInventorySlot.AMMO.getSlotIdx())
|
||||||
{
|
{
|
||||||
|
removeInfobox();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -118,8 +119,7 @@ public class AmmoPlugin extends Plugin
|
|||||||
|
|
||||||
if (!comp.isStackable())
|
if (!comp.isStackable())
|
||||||
{
|
{
|
||||||
infoBoxManager.removeInfoBox(counterBox);
|
removeInfobox();
|
||||||
counterBox = null;
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -134,9 +134,15 @@ public class AmmoPlugin extends Plugin
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
infoBoxManager.removeInfoBox(counterBox);
|
removeInfobox();
|
||||||
final BufferedImage image = itemManager.getImage(item.getId(), 5, false);
|
final BufferedImage image = itemManager.getImage(item.getId(), 5, false);
|
||||||
counterBox = new AmmoCounter(this, item.getId(), item.getQuantity(), comp.getName(), image);
|
counterBox = new AmmoCounter(this, item.getId(), item.getQuantity(), comp.getName(), image);
|
||||||
infoBoxManager.addInfoBox(counterBox);
|
infoBoxManager.addInfoBox(counterBox);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void removeInfobox()
|
||||||
|
{
|
||||||
|
infoBoxManager.removeInfoBox(counterBox);
|
||||||
|
counterBox = null;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user