Fixed some variable shadowing
This commit is contained in:
@@ -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);
|
||||
|
||||
@@ -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));
|
||||
|
||||
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user