Unit cap (#4689)
* Add unit caps as a map setting. * Use int and add maximum and minimum handling. * Put a lower limit of 0 for unit cap
This commit is contained in:
committed by
GitHub
parent
957583071d
commit
631e4d9eef
@@ -76,7 +76,7 @@ public class Units{
|
||||
if((team == state.rules.waveTeam && !state.rules.pvp) || (state.isCampaign() && team == state.rules.waveTeam)){
|
||||
return Integer.MAX_VALUE;
|
||||
}
|
||||
return state.rules.unitCap + indexer.getExtraUnits(team);
|
||||
return Math.max(0, state.rules.unitCapVariable ? state.rules.unitCap + indexer.getExtraUnits(team) : state.rules.unitCap);
|
||||
}
|
||||
|
||||
/** @return whether this player can interact with a specific tile. if either of these are null, returns true.*/
|
||||
|
||||
Reference in New Issue
Block a user