mirror of
https://github.com/Anuken/Mindustry.git
synced 2026-03-17 12:21:19 -07:00
Fix cheaty item and liquid turrets (#8176)
* Update Turret.java * Update TractorBeamTurret.java * Update TractorBeamTurret.java * Update ItemTurret.java * Update LiquidTurret.java
This commit is contained in:
parent
00d6b0d483
commit
0678592d59
3 changed files with 13 additions and 2 deletions
|
|
@ -88,7 +88,7 @@ public class ItemTurret extends Turret{
|
|||
super.onProximityAdded();
|
||||
|
||||
//add first ammo item to cheaty blocks so they can shoot properly
|
||||
if(cheating() && ammo.size > 0){
|
||||
if(cheating() && ammoTypes.size > 0){
|
||||
handleItem(this, ammoTypes.entries().next().key);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -59,6 +59,16 @@ public class LiquidTurret extends Turret{
|
|||
}
|
||||
|
||||
public class LiquidTurretBuild extends TurretBuild{
|
||||
|
||||
@Override
|
||||
public void onProximityAdded(){
|
||||
super.onProximityAdded();
|
||||
|
||||
//add first ammo liquid to cheaty blocks so they can shoot properly
|
||||
if(cheating() && ammoTypes.size > 0){
|
||||
handleLiquid(this, ammoTypes.entries().next().key, 1f);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean shouldActiveSound(){
|
||||
|
|
|
|||
|
|
@ -500,7 +500,8 @@ public class Turret extends ReloadTurret{
|
|||
if(ammo.size >= 2 && ammo.peek().amount < ammoPerShot && ammo.get(ammo.size - 2).amount >= ammoPerShot){
|
||||
ammo.swap(ammo.size - 1, ammo.size - 2);
|
||||
}
|
||||
return ammo.size > 0 && ammo.peek().amount >= ammoPerShot;
|
||||
|
||||
return ammo.size > 0 && ammo.peek().amount >= ammoPerShot || cheating();
|
||||
}
|
||||
|
||||
public boolean charging(){
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue