Balancing & bugfixes

This commit is contained in:
Anuken
2020-07-21 19:49:46 -04:00
parent 5cfd784501
commit 973d907218
7 changed files with 35 additions and 24 deletions

View File

@ -25,17 +25,16 @@ public class TeamIndexProcess implements AsyncProcess{
}
public int countType(Team team, UnitType type){
return typeCounts[team.id].length < type.id ? 0 : typeCounts[team.id][type.id];
return typeCounts[team.id].length <= type.id ? 0 : typeCounts[team.id][type.id];
}
public void updateCount(Team team, UnitType type, int amount){
int tid = type.id;
counts[team.id] += amount;
if(typeCounts[team.id].length < tid){
if(typeCounts[team.id].length <= type.id){
typeCounts[team.id] = new int[Vars.content.units().size];
}
typeCounts[team.id][tid] += amount;
typeCounts[team.id][type.id] += amount;
}
@Override