ammo: fix weapon check

This commit is contained in:
Hydrox6
2019-04-22 17:15:04 +01:00
committed by Adam
parent 917921dd47
commit adb0efe90c

View File

@@ -97,7 +97,7 @@ public class AmmoPlugin extends Plugin
{
// Check for weapon slot items. This overrides the ammo slot,
// as the player will use the thrown weapon (eg. chinchompas, knives, darts)
if (items.length >= EquipmentInventorySlot.WEAPON.getSlotIdx() - 1)
if (items.length > EquipmentInventorySlot.WEAPON.getSlotIdx())
{
final Item weapon = items[EquipmentInventorySlot.WEAPON.getSlotIdx()];
final ItemComposition weaponComp = itemManager.getItemComposition(weapon.getId());