Misc bug/crash fixes

This commit is contained in:
Anuken
2018-12-02 12:03:18 -05:00
parent 735935c0c4
commit 3397d6c907
7 changed files with 18 additions and 16 deletions
@@ -21,7 +21,7 @@ import java.io.IOException;
import static io.anuke.mindustry.Vars.*;
public class WaveSpawner{
private static final int quadsize = 4;
private static final int quadsize = 6;
private GridBits quadrants;
@@ -164,7 +164,7 @@ public class WaveSpawner{
for(int y = quady * quadsize; y < world.height() && y < (quady + 1) * quadsize; y++){
Tile tile = world.tile(x, y);
if(tile == null || tile.solid() || world.pathfinder.getValueforTeam(Team.red, x, y) == Float.MAX_VALUE){
if(tile == null || tile.solid() || world.pathfinder.getValueforTeam(Team.red, x, y) == Float.MAX_VALUE || tile.floor().isLiquid){
setQuad(quadx, quady, false);
break outer;
}
@@ -217,8 +217,8 @@ public class WaveSpawner{
//TODO instead of randomly scattering locations around the map, find spawns close to each other
private void findLocation(GroundSpawn spawn){
spawn.x = -1;
spawn.y = -1;
spawn.x = Mathf.random(quadWidth()-1);
spawn.y = Mathf.random(quadHeight()-1);
int shellWidth = quadWidth() * 2 + quadHeight() * 2 * 6;
shellWidth = Math.min(quadWidth() * quadHeight() / 4, shellWidth);