From f91910e84f7adb8c4866140ed7001af136ccf678 Mon Sep 17 00:00:00 2001 From: Sunny Kim <58885089+sk7725@users.noreply.github.com> Date: Tue, 19 Jan 2021 07:45:45 +0900 Subject: [PATCH] conductsTo() returning whether to conduct itself to adjacent builds (#4354) * conductsTo * insulated block no longer conducts * moved both checks to be symmetrical --- core/src/mindustry/entities/comp/BuildingComp.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/core/src/mindustry/entities/comp/BuildingComp.java b/core/src/mindustry/entities/comp/BuildingComp.java index 1fa2d7c372..f4758c427d 100644 --- a/core/src/mindustry/entities/comp/BuildingComp.java +++ b/core/src/mindustry/entities/comp/BuildingComp.java @@ -778,6 +778,10 @@ abstract class BuildingComp implements Posc, Teamc, Healthc, Buildingc, Timerc, } power.links.clear(); } + + public boolean conductsTo(Building other){ + return !block.insulated; + } public Seq getPowerConnections(Seq out){ out.clear(); @@ -786,7 +790,7 @@ abstract class BuildingComp implements Posc, Teamc, Healthc, Buildingc, Timerc, for(Building other : proximity){ if(other != null && other.power != null && !(block.consumesPower && other.block.consumesPower && !block.outputsPower && !other.block.outputsPower) - && !power.links.contains(other.pos())){ + && conductsTo(other) && other.conductsTo(self()) && !power.links.contains(other.pos())){ out.add(other); } }