Better team interaction

This commit is contained in:
Anuken
2019-02-15 12:32:01 -05:00
parent 070bb4d2d1
commit 7024273a02
5 changed files with 16 additions and 12 deletions
+2 -1
View File
@@ -23,9 +23,10 @@ public class Teams{
public TeamData get(Team team){
if(map[team.ordinal()] == null){
//By default, a non-defined team will be enemies of everything.
//neutral teams (none) do not have any enemies.
Team[] others = new Team[Team.all.length-1];
for(int i = 0, j = 0; i < Team.all.length; i++){
if(Team.all[i] != team) others[j++] = Team.all[i];
if(Team.all[i] != team && team != Team.none && Team.all[i] != Team.none) others[j++] = Team.all[i];
}
add(team, others);
}