Fixed crashes with team IDs above 127

This commit is contained in:
Anuken
2020-07-03 12:36:12 -04:00
parent 3772b04c6b
commit 843a8c3e56
18 changed files with 48 additions and 68 deletions

View File

@@ -4,7 +4,6 @@ import arc.*;
import arc.graphics.*;
import arc.math.*;
import arc.struct.*;
import arc.util.*;
import arc.util.ArcAnnotate.*;
import mindustry.game.Rules.*;
import mindustry.game.Teams.*;
@@ -14,8 +13,7 @@ import mindustry.world.blocks.storage.CoreBlock.*;
import static mindustry.Vars.*;
public class Team implements Comparable<Team>{
public final byte id;
public final int uid;
public final int id;
public final Color color;
public final Color[] palette;
public boolean hasPalette;
@@ -52,12 +50,10 @@ public class Team implements Comparable<Team>{
protected Team(int id, String name, Color color){
this.name = name;
this.color = color;
this.id = (byte)id;
this.id = id;
int us = Pack.u(this.id);
uid = us;
if(us < 6) baseTeams[us] = this;
all[us] = this;
if(id < 6) baseTeams[id] = this;
all[id] = this;
palette = new Color[3];
palette[0] = color;