Fixed minimap not updating when build team changes
This commit is contained in:
@@ -49,6 +49,7 @@ abstract class BuildingComp implements Posc, Teamc, Healthc, Buildingc, Timerc,
|
||||
static final float timeToSleep = 60f * 1, timeToUncontrol = 60f * 6;
|
||||
static final ObjectSet<Building> tmpTiles = new ObjectSet<>();
|
||||
static final Seq<Building> tempBuilds = new Seq<>();
|
||||
static final BuildTeamChangeEvent teamChangeEvent = new BuildTeamChangeEvent();
|
||||
static int sleepingEntities = 0;
|
||||
|
||||
@Import float x, y, health, maxHealth;
|
||||
@@ -1258,9 +1259,11 @@ abstract class BuildingComp implements Posc, Teamc, Healthc, Buildingc, Timerc,
|
||||
|
||||
/** Changes this building's team in a safe manner. */
|
||||
public void changeTeam(Team next){
|
||||
Team last = this.team;
|
||||
indexer.removeIndex(tile);
|
||||
this.team = next;
|
||||
indexer.addIndex(tile);
|
||||
Events.fire(teamChangeEvent.set(last, self()));
|
||||
}
|
||||
|
||||
public boolean canPickup(){
|
||||
|
||||
Reference in New Issue
Block a user