diff --git a/core/src/mindustry/core/Control.java b/core/src/mindustry/core/Control.java index e8a2821612..a3639060c1 100644 --- a/core/src/mindustry/core/Control.java +++ b/core/src/mindustry/core/Control.java @@ -260,8 +260,8 @@ public class Control implements ApplicationListener, Loadable{ state.rules.sector = sector; state.set(State.playing); }catch(SaveException e){ - sector.save = null; Log.err(e); + sector.save = null; ui.showErrorMessage("$save.corrupted"); slot.delete(); playSector(sector); diff --git a/core/src/mindustry/world/blocks/defense/turrets/DoubleTurret.java b/core/src/mindustry/world/blocks/defense/turrets/DoubleTurret.java index af3589dcb9..1bb60c12fb 100644 --- a/core/src/mindustry/world/blocks/defense/turrets/DoubleTurret.java +++ b/core/src/mindustry/world/blocks/defense/turrets/DoubleTurret.java @@ -25,10 +25,10 @@ public class DoubleTurret extends ItemTurret{ public class DoubleTurretEntity extends ItemTurretEntity{ @Override protected void shoot(BulletType ammo){ - shots++; + shotCount++; heat = 1f; - int i = Mathf.signs[shots % 2]; + int i = Mathf.signs[shotCount % 2]; tr.trns(rotation - 90, shotWidth * i, size * tilesize / 2); bullet(ammo, rotation + Mathf.range(inaccuracy)); diff --git a/core/src/mindustry/world/blocks/defense/turrets/Turret.java b/core/src/mindustry/world/blocks/defense/turrets/Turret.java index eb95e1b0a2..ba99f1abd9 100644 --- a/core/src/mindustry/world/blocks/defense/turrets/Turret.java +++ b/core/src/mindustry/world/blocks/defense/turrets/Turret.java @@ -122,7 +122,7 @@ public abstract class Turret extends Block{ public float rotation = 90; public float recoil = 0f; public float heat; - public int shots; + public int shotCount; public Posc target; @Override @@ -217,7 +217,7 @@ public abstract class Turret extends Block{ entry.amount -= ammoPerShot; if(entry.amount == 0) ammo.pop(); totalAmmo -= ammoPerShot; - Time.run(reload / 2f, () -> ejectEffects()); + Time.run(reloadTime / 2f, () -> ejectEffects()); return entry.type(); } @@ -236,7 +236,7 @@ public abstract class Turret extends Block{ } protected void updateShooting(){ - if(reload >= reload){ + if(reload >= reloadTime){ BulletType type = peekAmmo(); shoot(type); @@ -254,7 +254,7 @@ public abstract class Turret extends Block{ tr.trns(rotation, size * tilesize / 2f, Mathf.range(xRand)); for(int i = 0; i < shots; i++){ - bullet(type, rotation + Mathf.range(inaccuracy + type.inaccuracy) + (i - shots / 2) * spread); + bullet(type, rotation + Mathf.range(inaccuracy + type.inaccuracy) + (i - shots / 2f) * spread); } effects();