Crash fixes

This commit is contained in:
Anuken
2018-01-17 19:49:58 -05:00
parent b6106dbc3b
commit 7a3aa91f09
5 changed files with 32 additions and 3 deletions

View File

@@ -173,7 +173,7 @@ public class Pathfind{
/**For an enemy that was just loaded from a save, find the node in the path it should be following.*/
void findNode(Enemy enemy){
if(enemy.lane >= Vars.control.getSpawnPoints().size){
if(enemy.lane >= Vars.control.getSpawnPoints().size || enemy.lane < 0){
enemy.lane = 0;
}

View File

@@ -4,6 +4,7 @@ import com.badlogic.gdx.Gdx;
import com.badlogic.gdx.graphics.Color;
import com.badlogic.gdx.utils.IntSet;
import com.badlogic.gdx.utils.TimeUtils;
import io.anuke.mindustry.Mindustry;
import io.anuke.mindustry.Vars;
import io.anuke.mindustry.core.GameState.State;
import io.anuke.mindustry.entities.Bullet;
@@ -270,6 +271,8 @@ public class NetClient extends Module {
if(player != null){
Gdx.app.postRunnable(player::remove);
}
Mindustry.platforms.updateRPC();
});
Net.handle(PlayerSpawnPacket.class, packet -> {
@@ -291,6 +294,8 @@ public class NetClient extends Module {
player.interpolator.last.set(player.x, player.y);
player.interpolator.target.set(player.x, player.y);
player.add();
Mindustry.platforms.updateRPC();
});
});

View File

@@ -29,7 +29,6 @@ import static io.anuke.mindustry.Vars.android;
public class Save14 extends SaveFileVersion{
public Save14(){
super(14);
}

View File

@@ -0,0 +1,25 @@
package io.anuke.mindustry.io.versions;
import io.anuke.mindustry.io.SaveFileVersion;
import java.io.DataInputStream;
import java.io.DataOutputStream;
import java.io.IOException;
public class Save15 extends SaveFileVersion {
private Save14 save = new Save14();
public Save15(){
super(15);
}
@Override
public void read(DataInputStream stream) throws IOException {
}
@Override
public void write(DataOutputStream stream) throws IOException {
}
}

View File

@@ -256,7 +256,7 @@ public class Conveyor extends Block{
ItemPos set(int value){
byte[] values = Bits.getBytes(value);
if(values[0] > Item.getAllItems().size)
if(values[0] >= Item.getAllItems().size || values[0] < 0)
item = null;
else
item = Item.getAllItems().get(values[0]);