implicit nullable types

This commit is contained in:
Anuken
2020-10-03 10:19:00 -04:00
parent 7a307bbe9c
commit 58a62ad19c
3 changed files with 6 additions and 4 deletions

View File

@@ -30,11 +30,11 @@ public class TeamIndexProcess implements AsyncProcess{
}
public void updateCount(Team team, UnitType type, int amount){
counts[team.id] += amount;
counts[team.id] = Math.max(amount + counts[team.id], 0);
if(typeCounts[team.id].length <= type.id){
typeCounts[team.id] = new int[Vars.content.units().size];
}
typeCounts[team.id][type.id] += amount;
typeCounts[team.id][type.id] = Math.max(amount + typeCounts[team.id][type.id], 0);
}
private void count(Unit unit){