SteamWar/FightSystem
Archiviert
13
1

Dirty hotfix of Points NPE

Signed-off-by: Lixfel <agga-games@gmx.de>
Dieser Commit ist enthalten in:
Lixfel 2020-01-27 17:36:00 +01:00
Ursprung 67ad92bc90
Commit 11251727bf

Datei anzeigen

@ -18,8 +18,8 @@ import java.util.Set;
public class WinconditionRelativePercent extends Wincondition{ public class WinconditionRelativePercent extends Wincondition{
private static final Set<Material> ignoredBlocks; private static final Set<Material> ignoredBlocks;
private static TeamPercent blue; private static TeamPercent blue = null;
private static TeamPercent red; private static TeamPercent red = null;
static{ static{
Set<Material> ignored = new HashSet<>(); Set<Material> ignored = new HashSet<>();
@ -33,17 +33,21 @@ public class WinconditionRelativePercent extends Wincondition{
} }
public static TeamPercent getBlue(){ public static TeamPercent getBlue(){
if(blue == null)
blue = new TeamPercent(Fight.getBlueTeam());
return blue; return blue;
} }
public static TeamPercent getRed(){ public static TeamPercent getRed(){
if(red == null)
red = new TeamPercent(Fight.getRedTeam());
return red; return red;
} }
@Override @Override
public void enable() { public void enable() {
blue = new TeamPercent(Fight.getBlueTeam()); getBlue();
red = new TeamPercent(Fight.getRedTeam()); getRed();
} }
@Override @Override