Crash fixes

This commit is contained in:
Anuken 2018-03-03 11:31:17 -05:00
parent ba46dacfdc
commit 2a41453bc8
6 changed files with 10 additions and 8 deletions

View File

@ -1,7 +1,7 @@
#Autogenerated file. Do not modify.
#Sat Mar 03 01:13:15 EST 2018
#Sat Mar 03 11:31:02 EST 2018
version=release
androidBuildCode=328
androidBuildCode=330
name=Mindustry
code=3.4
build=29
build=custom build

View File

@ -27,7 +27,7 @@ public class ThreadHandler {
public ThreadHandler(ThreadProvider impl){
this.impl = impl;
Timers.setDeltaProvider(() ->{
Timers.setDeltaProvider(() -> {
float result = impl.isOnThread() ? delta : Gdx.graphics.getDeltaTime()*60f;
return Math.min(Float.isNaN(result) ? 1f : result, 12f);
});

View File

@ -124,6 +124,8 @@ public class UI extends SceneModule{
@Override
public synchronized void update(){
if(Vars.debug && !Vars.showUI) return;
if(Graphics.drawing()) Graphics.end();
scene.act();
scene.draw();

View File

@ -240,7 +240,7 @@ public class World extends Module{
if(!tile.block().isMultiblock() && !tile.isLinked()){
tile.setBlock(Blocks.air);
}else{
Tile target = tile.isLinked() ? tile.getLinked() : tile;
Tile target = tile.target();
Array<Tile> removals = target.getLinkedTiles();
for(Tile toremove : removals){
//note that setting a new block automatically unlinks it

View File

@ -47,7 +47,7 @@ public class TeslaOrb extends Entity{
Array<SolidEntity> enemies = Entities.getNearby(enemyGroup, curx, cury, range*2f);
for(SolidEntity entity : enemies){
if(entity.distanceTo(curx, cury) < range && !hit.contains((Enemy)entity)){
if(entity != null && entity.distanceTo(curx, cury) < range && !hit.contains((Enemy)entity)){
hit.add((Enemy)entity);
points.add(new Vector2(entity.x + Mathf.range(shake), entity.y + Mathf.range(shake)));
damageEnemy((Enemy)entity);

View File

@ -70,9 +70,9 @@ public class Sorter extends Block{
}else{
Tile a = dest.getNearby(Mathf.mod(dir - 1, 4));
Tile b = dest.getNearby(Mathf.mod(dir + 1, 4));
boolean ac = !(a.block().instantTransfer && source.block().instantTransfer) &&
boolean ac = a != null && !(a.block().instantTransfer && source.block().instantTransfer) &&
a.block().acceptItem(item, a, dest);
boolean bc = !(b.block().instantTransfer && source.block().instantTransfer) &&
boolean bc = b != null && !(b.block().instantTransfer && source.block().instantTransfer) &&
b.block().acceptItem(item, b, dest);
if(ac && !bc){