diff --git a/core/src/mindustry/world/blocks/distribution/ItemBridge.java b/core/src/mindustry/world/blocks/distribution/ItemBridge.java index 828a6b714b..ff8228bf96 100644 --- a/core/src/mindustry/world/blocks/distribution/ItemBridge.java +++ b/core/src/mindustry/world/blocks/distribution/ItemBridge.java @@ -165,6 +165,13 @@ public class ItemBridge extends Block{ @Override public boolean onConfigureTileTapped(Tilec other){ + //reverse connection + if(other instanceof ItemBridgeEntity && ((ItemBridgeEntity)other).link == pos()){ + configure(other.pos()); + other.configure(-1); + return true; + } + if(linkValid(tile, other.tile())){ if(link == other.pos()){ configure(-1); diff --git a/core/src/mindustry/world/blocks/power/PowerNode.java b/core/src/mindustry/world/blocks/power/PowerNode.java index d3c2476cec..924eafa069 100644 --- a/core/src/mindustry/world/blocks/power/PowerNode.java +++ b/core/src/mindustry/world/blocks/power/PowerNode.java @@ -179,6 +179,10 @@ public class PowerNode extends PowerBlock{ tempTileEnts.clear(); graphs.clear(); + if(tile.entity != null && tile.entity.power() != null){ + graphs.add(tile.entity.power().graph); + } + Geometry.circle(tile.x, tile.y, (int)(laserRange + 2), (x, y) -> { Tilec other = world.ent(x, y); if(valid.get(other) && !tempTileEnts.contains(other)){ @@ -194,9 +198,7 @@ public class PowerNode extends PowerBlock{ tempTileEnts.each(valid, t -> { graphs.add(t.power().graph); - if(t.power().graph != tile.entity.power().graph){ - others.get(t); - } + others.get(t); }); } @@ -319,6 +321,7 @@ public class PowerNode extends PowerBlock{ configure(power.links.get(0)); } } + deselect(); return false; } @@ -339,16 +342,9 @@ public class PowerNode extends PowerBlock{ @Override public void drawConfigure(){ - Draw.color(Pal.accent); - - Lines.stroke(1.5f); - Lines.circle(x, y, - tile.block().size * tilesize / 2f + 1f + Mathf.absin(Time.time(), 4f, 1f)); - + Drawf.circles(x, y, tile.block().size * tilesize / 2f + 1f + Mathf.absin(Time.time(), 4f, 1f)); Drawf.circles(x, y, laserRange * tilesize); - Lines.stroke(1.5f); - for(int x = (int)(tile.x - laserRange - 2); x <= tile.x + laserRange + 2; x++){ for(int y = (int)(tile.y - laserRange - 2); y <= tile.y + laserRange + 2; y++){ Tilec link = world.ent(x, y);