Power pickup bugfixes
This commit is contained in:
@@ -1293,16 +1293,19 @@ abstract class BuildingComp implements Posc, Teamc, Healthc, Buildingc, Timerc,
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/** Called right before this building is picked up. */
|
||||||
public void pickedUp(){
|
public void pickedUp(){
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
/** Called right after this building is picked up. */
|
||||||
|
public void afterPickedUp(){
|
||||||
if(power != null){
|
if(power != null){
|
||||||
if(power.graph != null){
|
power.graph = new PowerGraph();
|
||||||
power.graph.removeList(self());
|
|
||||||
power.graph = new PowerGraph();
|
|
||||||
}
|
|
||||||
power.links.clear();
|
power.links.clear();
|
||||||
power.status = 0f;
|
power.status = 0f;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public void removeFromProximity(){
|
public void removeFromProximity(){
|
||||||
|
|||||||
@@ -93,6 +93,7 @@ abstract class PayloadComp implements Posc, Rotc, Hitboxc, Unitc{
|
|||||||
void pickup(Building tile){
|
void pickup(Building tile){
|
||||||
tile.pickedUp();
|
tile.pickedUp();
|
||||||
tile.tile.remove();
|
tile.tile.remove();
|
||||||
|
tile.afterPickedUp();
|
||||||
addPayload(new BuildPayload(tile));
|
addPayload(new BuildPayload(tile));
|
||||||
Fx.unitPickup.at(tile);
|
Fx.unitPickup.at(tile);
|
||||||
Events.fire(new PickupEvent(self(), tile));
|
Events.fire(new PickupEvent(self(), tile));
|
||||||
|
|||||||
Reference in New Issue
Block a user