This commit is contained in:
Anuken
2022-10-08 16:29:29 -04:00
parent 719a2f1419
commit 308219b68b

View File

@@ -237,11 +237,14 @@ public class PowerNode extends PowerBlock{
}
var worldRange = laserRange * tilesize;
team.data().buildingTree.intersect(tile.worldx() - worldRange, tile.worldy() - worldRange, worldRange * 2, worldRange * 2, build -> {
if(valid.get(build) && !tempBuilds.contains(build)){
tempBuilds.add(build);
}
});
var tree = team.data().buildingTree;
if(tree != null){
tree.intersect(tile.worldx() - worldRange, tile.worldy() - worldRange, worldRange * 2, worldRange * 2, build -> {
if(valid.get(build) && !tempBuilds.contains(build)){
tempBuilds.add(build);
}
});
}
tempBuilds.sort((a, b) -> {
int type = -Boolean.compare(a.block instanceof PowerNode, b.block instanceof PowerNode);
@@ -290,11 +293,14 @@ public class PowerNode extends PowerBlock{
}
var rangeWorld = maxRange * tilesize;
team.data().buildingTree.intersect(tile.worldx() - rangeWorld, tile.worldy() - rangeWorld, rangeWorld * 2, rangeWorld * 2, build -> {
if(valid.get(build) && !tempBuilds.contains(build)){
tempBuilds.add(build);
}
});
var tree = team.data().buildingTree;
if(tree != null){
tree.intersect(tile.worldx() - rangeWorld, tile.worldy() - rangeWorld, rangeWorld * 2, rangeWorld * 2, build -> {
if(valid.get(build) && !tempBuilds.contains(build)){
tempBuilds.add(build);
}
});
}
tempBuilds.sort((a, b) -> {
int type = -Boolean.compare(a.block instanceof PowerNode, b.block instanceof PowerNode);