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:
@@ -779,6 +779,10 @@ abstract class BuildingComp implements Posc, Teamc, Healthc, Buildingc, Timerc,
|
|||||||
power.links.clear();
|
power.links.clear();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public boolean conductsTo(Building other){
|
||||||
|
return !block.insulated;
|
||||||
|
}
|
||||||
|
|
||||||
public Seq<Building> getPowerConnections(Seq<Building> out){
|
public Seq<Building> getPowerConnections(Seq<Building> out){
|
||||||
out.clear();
|
out.clear();
|
||||||
if(power == null) return out;
|
if(power == null) return out;
|
||||||
@@ -786,7 +790,7 @@ abstract class BuildingComp implements Posc, Teamc, Healthc, Buildingc, Timerc,
|
|||||||
for(Building other : proximity){
|
for(Building other : proximity){
|
||||||
if(other != null && other.power != null
|
if(other != null && other.power != null
|
||||||
&& !(block.consumesPower && other.block.consumesPower && !block.outputsPower && !other.block.outputsPower)
|
&& !(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);
|
out.add(other);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user