Crash fixes
This commit is contained in:
@@ -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);
|
||||
});
|
||||
|
||||
@@ -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();
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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){
|
||||
|
||||
Reference in New Issue
Block a user