Turret payload shoot fix

This commit is contained in:
Anuken
2021-10-18 11:48:44 -04:00
parent 3c8e21ac6a
commit 4e92aa2000

View File

@@ -395,7 +395,7 @@ public class Turret extends ReloadTurret{
for(int i = 0; i < chargeEffects; i++){
Time.run(Mathf.random(chargeMaxDelay), () -> {
if(!isValid()) return;
if(dead) return;
tr.trns(rotation, shootLength);
chargeEffect.at(x + tr.x, y + tr.y, rotation);
});
@@ -404,7 +404,7 @@ public class Turret extends ReloadTurret{
charging = true;
Time.run(chargeTime, () -> {
if(!isValid()) return;
if(dead) return;
tr.trns(rotation, shootLength);
recoil = recoilAmount;
heat = 1f;
@@ -418,7 +418,7 @@ public class Turret extends ReloadTurret{
for(int i = 0; i < shots; i++){
int ii = i;
Time.run(burstSpacing * i, () -> {
if(!isValid() || !hasAmmo()) return;
if(dead || !hasAmmo()) return;
recoil = recoilAmount;
@@ -478,7 +478,7 @@ public class Turret extends ReloadTurret{
}
protected void ejectEffects(){
if(!isValid()) return;
if(dead) return;
//alternate sides when using a double turret
float scl = (shots == 2 && alternate && shotCounter % 2 == 1 ? -1f : 1f);