Bugfixes & cleanup

This commit is contained in:
Anuken
2020-10-26 23:09:51 -04:00
parent 8d7f96bf00
commit c0d0edfc89
15 changed files with 6885 additions and 6388 deletions

View File

@@ -11,7 +11,6 @@ import mindustry.content.*;
import mindustry.entities.units.*;
import mindustry.gen.*;
import mindustry.type.*;
import mindustry.world.*;
import mindustry.world.blocks.payloads.*;
import mindustry.world.blocks.storage.CoreBlock.*;
@@ -27,8 +26,6 @@ public class Teams{
public Seq<TeamData> active = new Seq<>();
/** Teams with block or unit presence. */
public Seq<TeamData> present = new Seq<>(TeamData.class);
/** Ores currently being mined. */
private IntMap<Unit> mined = new IntMap<>();
public Teams(){
active.add(get(Team.crux));
@@ -145,21 +142,7 @@ public class Teams{
}
}
/** @return whether this ore is not taken. */
public boolean isValidMine(Unit unit, Tile tile){
if(multimine) return true;
if(tile == null) return false;
Unit u = mined.get(tile.pos());
return u == unit || u == null;
}
public void registerMined(Tile tile, Unit unit){
if(tile == null || unit == null || multimine) return;
mined.put(tile.pos(), unit);
}
public void updateTeamStats(){
mined.clear();
present.clear();
for(Team team : Team.all){