Crash fixes
This commit is contained in:
@@ -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.*/
|
/**For an enemy that was just loaded from a save, find the node in the path it should be following.*/
|
||||||
void findNode(Enemy enemy){
|
void findNode(Enemy enemy){
|
||||||
if(enemy.lane >= Vars.control.getSpawnPoints().size){
|
if(enemy.lane >= Vars.control.getSpawnPoints().size || enemy.lane < 0){
|
||||||
enemy.lane = 0;
|
enemy.lane = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -4,6 +4,7 @@ import com.badlogic.gdx.Gdx;
|
|||||||
import com.badlogic.gdx.graphics.Color;
|
import com.badlogic.gdx.graphics.Color;
|
||||||
import com.badlogic.gdx.utils.IntSet;
|
import com.badlogic.gdx.utils.IntSet;
|
||||||
import com.badlogic.gdx.utils.TimeUtils;
|
import com.badlogic.gdx.utils.TimeUtils;
|
||||||
|
import io.anuke.mindustry.Mindustry;
|
||||||
import io.anuke.mindustry.Vars;
|
import io.anuke.mindustry.Vars;
|
||||||
import io.anuke.mindustry.core.GameState.State;
|
import io.anuke.mindustry.core.GameState.State;
|
||||||
import io.anuke.mindustry.entities.Bullet;
|
import io.anuke.mindustry.entities.Bullet;
|
||||||
@@ -270,6 +271,8 @@ public class NetClient extends Module {
|
|||||||
if(player != null){
|
if(player != null){
|
||||||
Gdx.app.postRunnable(player::remove);
|
Gdx.app.postRunnable(player::remove);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Mindustry.platforms.updateRPC();
|
||||||
});
|
});
|
||||||
|
|
||||||
Net.handle(PlayerSpawnPacket.class, packet -> {
|
Net.handle(PlayerSpawnPacket.class, packet -> {
|
||||||
@@ -291,6 +294,8 @@ public class NetClient extends Module {
|
|||||||
player.interpolator.last.set(player.x, player.y);
|
player.interpolator.last.set(player.x, player.y);
|
||||||
player.interpolator.target.set(player.x, player.y);
|
player.interpolator.target.set(player.x, player.y);
|
||||||
player.add();
|
player.add();
|
||||||
|
|
||||||
|
Mindustry.platforms.updateRPC();
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
@@ -29,7 +29,6 @@ import static io.anuke.mindustry.Vars.android;
|
|||||||
|
|
||||||
public class Save14 extends SaveFileVersion{
|
public class Save14 extends SaveFileVersion{
|
||||||
|
|
||||||
|
|
||||||
public Save14(){
|
public Save14(){
|
||||||
super(14);
|
super(14);
|
||||||
}
|
}
|
||||||
|
|||||||
25
core/src/io/anuke/mindustry/io/versions/Save15.java
Normal file
25
core/src/io/anuke/mindustry/io/versions/Save15.java
Normal 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 {
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -256,7 +256,7 @@ public class Conveyor extends Block{
|
|||||||
ItemPos set(int value){
|
ItemPos set(int value){
|
||||||
byte[] values = Bits.getBytes(value);
|
byte[] values = Bits.getBytes(value);
|
||||||
|
|
||||||
if(values[0] > Item.getAllItems().size)
|
if(values[0] >= Item.getAllItems().size || values[0] < 0)
|
||||||
item = null;
|
item = null;
|
||||||
else
|
else
|
||||||
item = Item.getAllItems().get(values[0]);
|
item = Item.getAllItems().get(values[0]);
|
||||||
|
|||||||
Reference in New Issue
Block a user