Save load crash fix / Minor name refactor

This commit is contained in:
Anuken
2018-09-03 22:37:46 -04:00
parent 3d0b02ee23
commit ff37e99d71
3 changed files with 8 additions and 5 deletions

View File

@@ -16,6 +16,9 @@ import java.io.DataInput;
import java.io.DataOutput;
import java.io.IOException;
import static io.anuke.mindustry.Vars.headless;
import static io.anuke.mindustry.Vars.players;
public class AlphaDrone extends FlyingUnit {
static final float followDistance = 80f;
@@ -82,8 +85,8 @@ public class AlphaDrone extends FlyingUnit {
public void readSave(DataInput stream) throws IOException{
super.readSave(stream);
if(!Net.active()){
leader = Vars.players[0];
if(!Net.active() && !headless){
leader = players[0];
}
}
}

View File

@@ -14,7 +14,7 @@ public enum GameMode{
noWaves{{
disableWaves = true;
hidden = true;
autoSpawn = true;
enemyCheat = true;
showPads = true;
}},
pvp{{
@@ -26,7 +26,7 @@ public enum GameMode{
respawnTime = 60 * 10;
}};
public boolean infiniteResources, disableWaveTimer, disableWaves, hidden, autoSpawn, isPvp, showPads;
public boolean infiniteResources, disableWaveTimer, disableWaves, hidden, enemyCheat, isPvp, showPads;
public float enemyCoreBuildRadius = 400f;
public float enemyCoreShieldRadius = 140f;
public float respawnTime = 60 * 4;

View File

@@ -261,7 +261,7 @@ public class Tile implements PosTrait, TargetTrait{
}
public boolean isEnemyCheat(){
return getTeam() == waveTeam && state.mode.autoSpawn;
return getTeam() == waveTeam && state.mode.enemyCheat;
}
public boolean isLinked(){