mirror of
https://github.com/Anuken/Mindustry.git
synced 2025-02-25 22:17:59 +07:00
Crash fix
This commit is contained in:
parent
4a216056d0
commit
7ba42cb26e
Binary file not shown.
Before Width: | Height: | Size: 2.0 KiB After Width: | Height: | Size: 2.0 KiB |
@ -3342,6 +3342,7 @@ public class Blocks{
|
||||
|
||||
shots = 4;
|
||||
alternate = true;
|
||||
widthSpread = true;
|
||||
spread = 4.6f;
|
||||
|
||||
restitution = 0.1f;
|
||||
|
@ -92,6 +92,10 @@ public class Sector{
|
||||
info.resources.remove(Blocks.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. */
|
||||
|
@ -837,6 +837,7 @@ public class PlanetDialog extends BaseDialog implements PlanetInterfaceRenderer{
|
||||
c.add("@sectors.resources").left().row();
|
||||
c.table(t -> {
|
||||
for(UnlockableContent uc : sector.info.resources){
|
||||
if(uc == null) continue;
|
||||
t.image(uc.uiIcon).padRight(3).size(iconSmall);
|
||||
}
|
||||
}).padLeft(10f).left().row();
|
||||
|
@ -86,7 +86,7 @@ public class Turret extends ReloadTurret{
|
||||
/** Ticks between shots if shots > 1. */
|
||||
public float burstSpacing = 0;
|
||||
/** 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. */
|
||||
public boolean accurateDelay = false;
|
||||
|
||||
@ -544,21 +544,25 @@ public class Turret extends ReloadTurret{
|
||||
}else{
|
||||
//otherwise, use the normal shot pattern(s)
|
||||
|
||||
if(alternate){
|
||||
float i = (shotCounter % shots) - (shots-1)/2f;
|
||||
if(alternate || widthSpread){
|
||||
int count = !widthSpread ? 1 : shots;
|
||||
|
||||
bulletOffset.trns(rotation - 90, (spread) * i + Mathf.range(xRand), shootLength);
|
||||
bullet(type, rotation + Mathf.range(inaccuracy + type.inaccuracy));
|
||||
for(int c = 0; c < count; c++){
|
||||
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{
|
||||
bulletOffset.trns(rotation, shootLength, Mathf.range(xRand));
|
||||
|
||||
for(int i = 0; i < shots; i++){
|
||||
bullet(type, rotation + Mathf.range(inaccuracy + type.inaccuracy) + (i - (int)(shots / 2f)) * spread);
|
||||
shotCounter ++;
|
||||
}
|
||||
}
|
||||
|
||||
shotCounter++;
|
||||
|
||||
recoil = recoilAmount;
|
||||
heat = 1f;
|
||||
effects();
|
||||
|
@ -24,4 +24,4 @@ android.useAndroidX=true
|
||||
#used for slow jitpack builds; TODO see if this actually works
|
||||
org.gradle.internal.http.socketTimeout=100000
|
||||
org.gradle.internal.http.connectionTimeout=100000
|
||||
archash=502eb9934e
|
||||
archash=985a940948
|
||||
|
Loading…
Reference in New Issue
Block a user