From d969741f9031d4edf37a14524212e0849d2d6fdf Mon Sep 17 00:00:00 2001 From: Patrick 'Quezler' Mounier Date: Sun, 27 Oct 2019 16:01:50 +0100 Subject: [PATCH] =?UTF-8?q?=E2=9A=A1=EF=B8=8F=20Toggle=20(all)=20powernode?= =?UTF-8?q?=20connections=20by=20doubleclicking=20(#907)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Toggle (all) powernode connections by doubleclicking * Mimic return false of the above if --- .../mindustry/world/blocks/power/PowerNode.java | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/core/src/io/anuke/mindustry/world/blocks/power/PowerNode.java b/core/src/io/anuke/mindustry/world/blocks/power/PowerNode.java index cc6c9f5952..ac4f95aa3e 100644 --- a/core/src/io/anuke/mindustry/world/blocks/power/PowerNode.java +++ b/core/src/io/anuke/mindustry/world/blocks/power/PowerNode.java @@ -167,6 +167,18 @@ public class PowerNode extends PowerBlock{ tile.configure(other.pos()); return false; } + + if(tile == other){ + if (other.entity.power.links.size == 0){ + getPotentialLinks(tile, link -> tile.configure(link.pos())); + } else { + while (entity.power.links.size > 0){ + tile.configure(entity.power.links.get(0)); + } + } + return false; + } + return true; }