Fixed #2543
This commit is contained in:
@@ -76,6 +76,12 @@ abstract class BuildingComp implements Posc, Teamc, Healthc, Buildingc, Timerc,
|
|||||||
public Building init(Tile tile, Team team, boolean shouldAdd, int rotation){
|
public Building init(Tile tile, Team team, boolean shouldAdd, int rotation){
|
||||||
if(!initialized){
|
if(!initialized){
|
||||||
create(tile.block(), team);
|
create(tile.block(), team);
|
||||||
|
}else{
|
||||||
|
if(block.hasPower){
|
||||||
|
//reinit power graph
|
||||||
|
power.graph = new PowerGraph();
|
||||||
|
power.graph.add(base());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
this.rotation = rotation;
|
this.rotation = rotation;
|
||||||
this.tile = tile;
|
this.tile = tile;
|
||||||
@@ -697,6 +703,7 @@ abstract class BuildingComp implements Posc, Teamc, Healthc, Buildingc, Timerc,
|
|||||||
other.build.power.links.removeValue(pos());
|
other.build.power.links.removeValue(pos());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
power.links.clear();
|
||||||
}
|
}
|
||||||
|
|
||||||
public Seq<Building> getPowerConnections(Seq<Building> out){
|
public Seq<Building> getPowerConnections(Seq<Building> out){
|
||||||
|
|||||||
@@ -99,8 +99,11 @@ public class Wall extends Block{
|
|||||||
|
|
||||||
//deflect bullets if necessary
|
//deflect bullets if necessary
|
||||||
if(deflect){
|
if(deflect){
|
||||||
|
//slow bullets are not deflected
|
||||||
|
if(bullet.vel().len() <= 0.2f) return true;
|
||||||
|
|
||||||
//bullet reflection chance depends on bullet damage
|
//bullet reflection chance depends on bullet damage
|
||||||
if(!Mathf.chance(chanceDeflect/bullet.damage())) return true;
|
if(!Mathf.chance(chanceDeflect / bullet.damage())) return true;
|
||||||
|
|
||||||
//translate bullet back to where it was upon collision
|
//translate bullet back to where it was upon collision
|
||||||
bullet.trns(-bullet.vel.x, -bullet.vel.y);
|
bullet.trns(-bullet.vel.x, -bullet.vel.y);
|
||||||
|
|||||||
Reference in New Issue
Block a user