Skip to content

Commit

Permalink
add playerControllable for turrets (#6019)
Browse files Browse the repository at this point in the history
  • Loading branch information
JniTrRny committed Sep 18, 2021
1 parent e4e1bac commit 47dc9c7
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions core/src/mindustry/world/blocks/defense/turrets/Turret.java
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ public class Turret extends ReloadTurret{
public boolean targetAir = true;
public boolean targetGround = true;
public boolean targetHealing = false;
public boolean playerControllable = true;

//charging
public float chargeTime = -1f;
Expand Down Expand Up @@ -157,6 +158,11 @@ public void created(){
unit.tile(this);
}

@Override
public boolean canControl(){
return playerControllable;
}

@Override
public void control(LAccess type, double p1, double p2, double p3, double p4){
if(type == LAccess.shoot && (unit == null || !unit.isPlayer())){
Expand Down

0 comments on commit 47dc9c7

Please sign in to comment.