Crash fix

This commit is contained in:
Anuken
2022-02-11 12:19:15 -05:00
parent 4a216056d0
commit 7ba42cb26e
6 changed files with 18 additions and 8 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.0 KiB

After

Width:  |  Height:  |  Size: 2.0 KiB

View File

@@ -3342,6 +3342,7 @@ public class Blocks{
shots = 4; shots = 4;
alternate = true; alternate = true;
widthSpread = true;
spread = 4.6f; spread = 4.6f;
restitution = 0.1f; restitution = 0.1f;

View File

@@ -92,6 +92,10 @@ public class Sector{
info.resources.remove(Blocks.water); info.resources.remove(Blocks.water);
info.resources.add(Liquids.water); info.resources.add(Liquids.water);
} }
if(info.resources.contains(u -> u == null)){
info.resources = info.resources.select(u -> u != null);
}
} }
/** Removes any sector info. */ /** Removes any sector info. */

View File

@@ -837,6 +837,7 @@ public class PlanetDialog extends BaseDialog implements PlanetInterfaceRenderer{
c.add("@sectors.resources").left().row(); c.add("@sectors.resources").left().row();
c.table(t -> { c.table(t -> {
for(UnlockableContent uc : sector.info.resources){ for(UnlockableContent uc : sector.info.resources){
if(uc == null) continue;
t.image(uc.uiIcon).padRight(3).size(iconSmall); t.image(uc.uiIcon).padRight(3).size(iconSmall);
} }
}).padLeft(10f).left().row(); }).padLeft(10f).left().row();

View File

@@ -86,7 +86,7 @@ public class Turret extends ReloadTurret{
/** Ticks between shots if shots > 1. */ /** Ticks between shots if shots > 1. */
public float burstSpacing = 0; public float burstSpacing = 0;
/** An inflexible and terrible idea. */ /** An inflexible and terrible idea. */
public boolean alternate = false; public boolean alternate = false, widthSpread = false;
/** If true, this turret will accurately target moving targets with respect to charge time. */ /** If true, this turret will accurately target moving targets with respect to charge time. */
public boolean accurateDelay = false; public boolean accurateDelay = false;
@@ -544,21 +544,25 @@ public class Turret extends ReloadTurret{
}else{ }else{
//otherwise, use the normal shot pattern(s) //otherwise, use the normal shot pattern(s)
if(alternate){ if(alternate || widthSpread){
float i = (shotCounter % shots) - (shots-1)/2f; int count = !widthSpread ? 1 : shots;
bulletOffset.trns(rotation - 90, (spread) * i + Mathf.range(xRand), shootLength); for(int c = 0; c < count; c++){
bullet(type, rotation + Mathf.range(inaccuracy + type.inaccuracy)); float i = (shotCounter % shots) - (shots-1)/2f;
bulletOffset.trns(rotation - 90, (spread) * i + Mathf.range(xRand), shootLength);
bullet(type, rotation + Mathf.range(inaccuracy + type.inaccuracy));
shotCounter ++;
}
}else{ }else{
bulletOffset.trns(rotation, shootLength, Mathf.range(xRand)); bulletOffset.trns(rotation, shootLength, 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 - (int)(shots / 2f)) * spread); bullet(type, rotation + Mathf.range(inaccuracy + type.inaccuracy) + (i - (int)(shots / 2f)) * spread);
shotCounter ++;
} }
} }
shotCounter++;
recoil = recoilAmount; recoil = recoilAmount;
heat = 1f; heat = 1f;
effects(); effects();

View File

@@ -24,4 +24,4 @@ android.useAndroidX=true
#used for slow jitpack builds; TODO see if this actually works #used for slow jitpack builds; TODO see if this actually works
org.gradle.internal.http.socketTimeout=100000 org.gradle.internal.http.socketTimeout=100000
org.gradle.internal.http.connectionTimeout=100000 org.gradle.internal.http.connectionTimeout=100000
archash=502eb9934e archash=985a940948