Fixed certain turrets working without ammo
This commit is contained in:
Binary file not shown.
|
Before Width: | Height: | Size: 426 B After Width: | Height: | Size: 502 B |
@@ -465,6 +465,8 @@ public class Turret extends ReloadTurret{
|
|||||||
|
|
||||||
/** @return whether the turret has ammo. */
|
/** @return whether the turret has ammo. */
|
||||||
public boolean hasAmmo(){
|
public boolean hasAmmo(){
|
||||||
|
if(!cons.canConsume()) return false;
|
||||||
|
|
||||||
//skip first entry if it has less than the required amount of ammo
|
//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){
|
if(ammo.size >= 2 && ammo.peek().amount < ammoPerShot && ammo.get(ammo.size - 2).amount >= ammoPerShot){
|
||||||
totalAmmo -= ammo.pop().amount;
|
totalAmmo -= ammo.pop().amount;
|
||||||
|
|||||||
Reference in New Issue
Block a user