This commit is contained in:
Anuken
2020-10-29 11:51:17 -04:00
parent 2ad14cc884
commit 0c418d1a09
3 changed files with 5 additions and 2 deletions

View File

@@ -261,11 +261,12 @@ public class Teams{
}
public void updateCount(UnitType type, int amount){
if(type == null) return;
unitCount = Math.max(amount + unitCount, 0);
if(typeCounts == null || typeCounts.length <= type.id){
typeCounts = new int[Vars.content.units().size];
}
typeCounts[type.id] = Math.max(amount + typeCounts [type.id], 0);
typeCounts[type.id] = Math.max(amount + typeCounts[type.id], 0);
}
public QuadTree<Unit> tree(){