Fixed some variable shadowing
This commit is contained in:
@@ -260,8 +260,8 @@ public class Control implements ApplicationListener, Loadable{
|
|||||||
state.rules.sector = sector;
|
state.rules.sector = sector;
|
||||||
state.set(State.playing);
|
state.set(State.playing);
|
||||||
}catch(SaveException e){
|
}catch(SaveException e){
|
||||||
sector.save = null;
|
|
||||||
Log.err(e);
|
Log.err(e);
|
||||||
|
sector.save = null;
|
||||||
ui.showErrorMessage("$save.corrupted");
|
ui.showErrorMessage("$save.corrupted");
|
||||||
slot.delete();
|
slot.delete();
|
||||||
playSector(sector);
|
playSector(sector);
|
||||||
|
|||||||
@@ -25,10 +25,10 @@ public class DoubleTurret extends ItemTurret{
|
|||||||
public class DoubleTurretEntity extends ItemTurretEntity{
|
public class DoubleTurretEntity extends ItemTurretEntity{
|
||||||
@Override
|
@Override
|
||||||
protected void shoot(BulletType ammo){
|
protected void shoot(BulletType ammo){
|
||||||
shots++;
|
shotCount++;
|
||||||
heat = 1f;
|
heat = 1f;
|
||||||
|
|
||||||
int i = Mathf.signs[shots % 2];
|
int i = Mathf.signs[shotCount % 2];
|
||||||
|
|
||||||
tr.trns(rotation - 90, shotWidth * i, size * tilesize / 2);
|
tr.trns(rotation - 90, shotWidth * i, size * tilesize / 2);
|
||||||
bullet(ammo, rotation + Mathf.range(inaccuracy));
|
bullet(ammo, rotation + Mathf.range(inaccuracy));
|
||||||
|
|||||||
@@ -122,7 +122,7 @@ public abstract class Turret extends Block{
|
|||||||
public float rotation = 90;
|
public float rotation = 90;
|
||||||
public float recoil = 0f;
|
public float recoil = 0f;
|
||||||
public float heat;
|
public float heat;
|
||||||
public int shots;
|
public int shotCount;
|
||||||
public Posc target;
|
public Posc target;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -217,7 +217,7 @@ public abstract class Turret extends Block{
|
|||||||
entry.amount -= ammoPerShot;
|
entry.amount -= ammoPerShot;
|
||||||
if(entry.amount == 0) ammo.pop();
|
if(entry.amount == 0) ammo.pop();
|
||||||
totalAmmo -= ammoPerShot;
|
totalAmmo -= ammoPerShot;
|
||||||
Time.run(reload / 2f, () -> ejectEffects());
|
Time.run(reloadTime / 2f, () -> ejectEffects());
|
||||||
return entry.type();
|
return entry.type();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -236,7 +236,7 @@ public abstract class Turret extends Block{
|
|||||||
}
|
}
|
||||||
|
|
||||||
protected void updateShooting(){
|
protected void updateShooting(){
|
||||||
if(reload >= reload){
|
if(reload >= reloadTime){
|
||||||
BulletType type = peekAmmo();
|
BulletType type = peekAmmo();
|
||||||
|
|
||||||
shoot(type);
|
shoot(type);
|
||||||
@@ -254,7 +254,7 @@ public abstract class Turret extends Block{
|
|||||||
tr.trns(rotation, size * tilesize / 2f, Mathf.range(xRand));
|
tr.trns(rotation, size * tilesize / 2f, Mathf.range(xRand));
|
||||||
|
|
||||||
for(int i = 0; i < shots; i++){
|
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();
|
effects();
|
||||||
|
|||||||
Reference in New Issue
Block a user