This commit is contained in:
Anuken
2020-09-12 09:51:57 -04:00
parent c95f0674b6
commit 197b67f8c1
2 changed files with 11 additions and 1 deletions

View File

@@ -76,6 +76,12 @@ abstract class BuildingComp implements Posc, Teamc, Healthc, Buildingc, Timerc,
public Building init(Tile tile, Team team, boolean shouldAdd, int rotation){
if(!initialized){
create(tile.block(), team);
}else{
if(block.hasPower){
//reinit power graph
power.graph = new PowerGraph();
power.graph.add(base());
}
}
this.rotation = rotation;
this.tile = tile;
@@ -697,6 +703,7 @@ abstract class BuildingComp implements Posc, Teamc, Healthc, Buildingc, Timerc,
other.build.power.links.removeValue(pos());
}
}
power.links.clear();
}
public Seq<Building> getPowerConnections(Seq<Building> out){