Fixed drones not finding blocked ores

This commit is contained in:
Anuken 2019-09-01 13:21:20 -04:00
parent 2fe5b44698
commit 40d27c787c
5 changed files with 9 additions and 10 deletions

View File

@ -242,14 +242,13 @@ public class BlockIndexer{
int quadrantY = tile.y / quadrantSize; int quadrantY = tile.y / quadrantSize;
itemSet.clear(); itemSet.clear();
Tile rounded = world.tile(Mathf.clamp(quadrantX * quadrantSize + quadrantSize / 2, 0, world.width() - 1), Tile rounded = world.tile(Mathf.clamp(quadrantX * quadrantSize + quadrantSize / 2, 0, world.width() - 1), Mathf.clamp(quadrantY * quadrantSize + quadrantSize / 2, 0, world.height() - 1));
Mathf.clamp(quadrantY * quadrantSize + quadrantSize / 2, 0, world.height() - 1));
//find all items that this quadrant contains //find all items that this quadrant contains
for(int x = quadrantX * quadrantSize; x < world.width() && x < (quadrantX + 1) * quadrantSize; x++){ for(int x = Math.max(0, rounded.x - quadrantSize / 2); x < rounded.x + quadrantSize / 2 && x < world.width(); x++){
for(int y = quadrantY * quadrantSize; y < world.height() && y < (quadrantY + 1) * quadrantSize; y++){ for(int y = Math.max(0, rounded.y - quadrantSize / 2); y < rounded.y + quadrantSize / 2 && y < world.height(); y++){
Tile result = world.tile(x, y); Tile result = world.tile(x, y);
if(result == null || result.drop() == null || !scanOres.contains(result.drop())) continue; if(result == null || result.drop() == null || !scanOres.contains(result.drop()) || result.block() != Blocks.air) continue;
itemSet.add(result.drop()); itemSet.add(result.drop());
} }

View File

@ -261,7 +261,7 @@ public class NetServer implements ApplicationListener{
} }
//cooldown between votes //cooldown between votes
int voteTime = 60 * 10; int voteTime = 60 * 5;
Timekeeper vtime = new Timekeeper(voteTime); Timekeeper vtime = new Timekeeper(voteTime);
//current kick sessions //current kick sessions
ObjectMap<Player, VoteSession> currentlyKicking = new ObjectMap<>(); ObjectMap<Player, VoteSession> currentlyKicking = new ObjectMap<>();
@ -332,7 +332,7 @@ public class NetServer implements ApplicationListener{
} }
public int votesRequired(){ public int votesRequired(){
return playerGroup.size() * 2 / 3; return 2 + (int)(playerGroup.size() * 0.2f);
} }
public Team assignTeam(Player current, Iterable<Player> players){ public Team assignTeam(Player current, Iterable<Player> players){

View File

@ -14,7 +14,7 @@ import static io.anuke.mindustry.Vars.*;
/** Controls playback of multiple music tracks.*/ /** Controls playback of multiple music tracks.*/
public class MusicControl{ public class MusicControl{
private static final float finTime = 120f, foutTime = 120f, musicInterval = 60 * 60 * 3f, musicChance = 0.5f, musicWaveChance = 0.4f; private static final float finTime = 120f, foutTime = 120f, musicInterval = 60 * 60 * 3f, musicChance = 0.6f, musicWaveChance = 0.5f;
/** normal, ambient music, plays at any time */ /** normal, ambient music, plays at any time */
public final Array<Music> ambientMusic = Array.with(Musics.game1, Musics.game3, Musics.game4, Musics.game6); public final Array<Music> ambientMusic = Array.with(Musics.game1, Musics.game3, Musics.game4, Musics.game6);

View File

@ -80,7 +80,7 @@ public class MapsDialog extends FloatingDialog{
String name = map.tags.getOr("name", () -> { String name = map.tags.getOr("name", () -> {
String result = "unknown"; String result = "unknown";
int number = 0; int number = 0;
while(maps.byName(result + number++) != null) ; while(maps.byName(result + number++) != null);
return result + number; return result + number;
}); });

View File

@ -37,7 +37,7 @@ public class ItemLiquidGenerator extends PowerGenerator{
protected Effects.Effect explodeEffect = Fx.generatespark; protected Effects.Effect explodeEffect = Fx.generatespark;
protected Color heatColor = Color.valueOf("ff9b59"); protected Color heatColor = Color.valueOf("ff9b59");
protected TextureRegion topRegion, liquidRegion; protected TextureRegion topRegion, liquidRegion;
protected boolean randomlyExplode = false; protected boolean randomlyExplode = true;
public ItemLiquidGenerator(boolean hasItems, boolean hasLiquids, String name){ public ItemLiquidGenerator(boolean hasItems, boolean hasLiquids, String name){
super(name); super(name);