mirror of
https://github.com/Anuken/Mindustry.git
synced 2025-07-09 23:37:51 +07:00
crashfix
This commit is contained in:
@ -1,5 +1,6 @@
|
||||
package io.anuke.mindustry.game;
|
||||
|
||||
import io.anuke.arc.collection.Array;
|
||||
import io.anuke.arc.collection.EnumSet;
|
||||
import io.anuke.arc.collection.ObjectSet;
|
||||
import io.anuke.mindustry.Vars;
|
||||
@ -22,13 +23,7 @@ public class Teams{
|
||||
/**Returns team data by type.*/
|
||||
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 && team != Team.none && Team.all[i] != Team.none) others[j++] = Team.all[i];
|
||||
}
|
||||
add(team, others);
|
||||
add(team, Array.with(Team.all).select(t -> t != team && t != Team.none && team != Team.none).toArray(Team.class));
|
||||
}
|
||||
return map[team.ordinal()];
|
||||
}
|
||||
|
Reference in New Issue
Block a user