Fixed certain turrets working without ammo

This commit is contained in:
Anuken
2022-01-15 23:08:54 -05:00
parent f91619e5da
commit 93cfa243bc
2 changed files with 2 additions and 0 deletions

View File

@@ -465,6 +465,8 @@ public class Turret extends ReloadTurret{
/** @return whether the turret has ammo. */
public boolean hasAmmo(){
if(!cons.canConsume()) return false;
//skip first entry if it has less than the required amount of ammo
if(ammo.size >= 2 && ammo.peek().amount < ammoPerShot && ammo.get(ammo.size - 2).amount >= ammoPerShot){
totalAmmo -= ammo.pop().amount;