Skip to content

Commit

Permalink
Fix low durability ammos (javelins) possibly having 0 max ammo
Browse files Browse the repository at this point in the history
  • Loading branch information
bonii-xx committed Nov 1, 2014
1 parent ce8b37a commit 206e2ff
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/main/java/tconstruct/library/weaponry/AmmoItem.java
Expand Up @@ -37,7 +37,7 @@ public int getMaxAmmo(ItemStack stack) {
@Override
public int getMaxAmmo(NBTTagCompound tags) {
float dur = tags.getInteger("TotalDurability");
return (int)Math.ceil(dur*getAmmoModifier());
return Math.max(1, (int)Math.ceil(dur*getAmmoModifier()));
}

@Override
Expand Down

0 comments on commit 206e2ff

Please sign in to comment.