Validate teams with power links
This commit is contained in:
@@ -792,6 +792,7 @@ abstract class BuildingComp implements Posc, Teamc, Healthc, Buildingc, Timerc,
|
||||
|
||||
for(Building other : proximity){
|
||||
if(other != null && other.power != null
|
||||
&& other.team == team
|
||||
&& !(block.consumesPower && other.block.consumesPower && !block.outputsPower && !other.block.outputsPower)
|
||||
&& conductsTo(other) && other.conductsTo(self()) && !power.links.contains(other.pos())){
|
||||
out.add(other);
|
||||
@@ -800,7 +801,7 @@ abstract class BuildingComp implements Posc, Teamc, Healthc, Buildingc, Timerc,
|
||||
|
||||
for(int i = 0; i < power.links.size; i++){
|
||||
Tile link = world.tile(power.links.get(i));
|
||||
if(link != null && link.build != null && link.build.power != null) out.add(link.build);
|
||||
if(link != null && link.build != null && link.build.power != null && link.build.team == team) out.add(link.build);
|
||||
}
|
||||
return out;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user