Merge remote-tracking branch 'origin/master'
This commit is contained in:
@@ -396,7 +396,7 @@ public class Weapon implements Cloneable{
|
||||
mount.warmup >= minWarmup && //must be warmed up
|
||||
unit.vel.len() >= minShootVelocity && //check velocity requirements
|
||||
(mount.reload <= 0.0001f || (alwaysContinuous && mount.bullet == null)) && //reload has to be 0, or it has to be an always-continuous weapon
|
||||
Angles.within(rotate ? mount.rotation : unit.rotation + baseRotation, mount.targetRotation, shootCone) //has to be within the cone
|
||||
(alwaysShooting || Angles.within(rotate ? mount.rotation : unit.rotation + baseRotation, mount.targetRotation, shootCone)) //has to be within the cone
|
||||
){
|
||||
shoot(unit, mount, bulletX, bulletY, shootAngle);
|
||||
|
||||
|
||||
@@ -83,6 +83,8 @@ public class Turret extends ReloadTurret{
|
||||
public boolean displayAmmoMultiplier = true;
|
||||
/** If false, 'under' blocks like conveyors are not targeted. */
|
||||
public boolean targetUnderBlocks = true;
|
||||
/** If true, the turret will always shoot when it has ammo, regardless of targets in range or any control. */
|
||||
public boolean alwaysShooting = false;
|
||||
/** Function for choosing which unit to target. */
|
||||
public Sortf unitSort = UnitSorts.closest;
|
||||
/** Filter for types of units to attack. */
|
||||
@@ -304,7 +306,7 @@ public class Turret extends ReloadTurret{
|
||||
}
|
||||
|
||||
public boolean isShooting(){
|
||||
return (isControlled() ? unit.isShooting() : logicControlled() ? logicShooting : target != null);
|
||||
return alwaysShooting || (isControlled() ? unit.isShooting() : logicControlled() ? logicShooting : target != null);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -425,11 +427,16 @@ public class Turret extends ReloadTurret{
|
||||
turnToTarget(targetRot);
|
||||
}
|
||||
|
||||
if(Angles.angleDist(rotation, targetRot) < shootCone && canShoot){
|
||||
if(!alwaysShooting && Angles.angleDist(rotation, targetRot) < shootCone && canShoot){
|
||||
wasShooting = true;
|
||||
updateShooting();
|
||||
}
|
||||
}
|
||||
|
||||
if(alwaysShooting){
|
||||
wasShooting = true;
|
||||
updateShooting();
|
||||
}
|
||||
}
|
||||
|
||||
if(coolant != null){
|
||||
|
||||
Reference in New Issue
Block a user