This commit is contained in:
Anuken
2020-10-09 10:02:08 -04:00
parent e2b58528d0
commit 22f1c3b2d1
8 changed files with 49 additions and 30 deletions

View File

@@ -351,8 +351,9 @@ public abstract class Turret extends Block{
AmmoEntry entry = ammo.peek();
entry.amount -= ammoPerShot;
if(entry.amount == 0) ammo.pop();
if(entry.amount <= 0) ammo.pop();
totalAmmo -= ammoPerShot;
totalAmmo = Math.max(totalAmmo, 0);
Time.run(reloadTime / 2f, this::ejectEffects);
return entry.type();
}
@@ -364,7 +365,7 @@ public abstract class Turret extends Block{
/** @return whether the turret has ammo. */
public boolean hasAmmo(){
return ammo.size > 0 && ammo.peek().amount >= ammoPerShot;
return ammo.size > 0 && ammo.peek().amount >= 1;
}
protected void updateShooting(){