conductsTo() returning whether to conduct itself to adjacent builds (#4354)

* conductsTo

* insulated block no longer conducts

* moved both checks to be symmetrical
This commit is contained in:
Sunny Kim
2021-01-19 07:45:45 +09:00
committed by GitHub
parent 2da128678a
commit f91910e84f

View File

@ -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<Building> getPowerConnections(Seq<Building> 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);
}
}