Fixed blocks linking through insulated walls

This commit is contained in:
Anuken
2021-03-12 13:16:35 -05:00
parent f04e763667
commit 2c08b82fef
2 changed files with 1 additions and 1 deletions

View File

@@ -37,7 +37,6 @@ public class LParser{
}
void error(String message){
//TODO
throw new RuntimeException("Invalid code. " + message);
}

View File

@@ -252,6 +252,7 @@ public class PowerNode extends PowerBlock{
other.power.links.size < node.maxNodes &&
node.overlaps(other.x, other.y, tile, block, node.laserRange * tilesize) && other.team == team
&& !graphs.contains(other.power.graph) &&
!PowerNode.insulated(tile, other.tile) &&
!Structs.contains(Edges.getEdges(block.size), p -> { //do not link to adjacent buildings
var t = world.tile(tile.x + p.x, tile.y + p.y);
return t != null && t.build == other;