Many crashes fixed, added server run script
This commit is contained in:
@@ -1,5 +1,5 @@
|
|||||||
#Autogenerated file. Do not modify.
|
#Autogenerated file. Do not modify.
|
||||||
#Fri Feb 16 11:30:06 EST 2018
|
#Sat Feb 17 11:08:49 EST 2018
|
||||||
version=beta
|
version=beta
|
||||||
androidBuildCode=234
|
androidBuildCode=234
|
||||||
name=Mindustry
|
name=Mindustry
|
||||||
|
|||||||
@@ -50,6 +50,7 @@ public class Control extends Module{
|
|||||||
private InputProxy proxy;
|
private InputProxy proxy;
|
||||||
private float controlx, controly;
|
private float controlx, controly;
|
||||||
private boolean controlling;
|
private boolean controlling;
|
||||||
|
private Throwable error;
|
||||||
|
|
||||||
public Control(){
|
public Control(){
|
||||||
saves = new Saves();
|
saves = new Saves();
|
||||||
@@ -195,6 +196,10 @@ public class Control extends Module{
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void setError(Throwable error){
|
||||||
|
this.error = error;
|
||||||
|
}
|
||||||
|
|
||||||
public UpgradeInventory upgrades() {
|
public UpgradeInventory upgrades() {
|
||||||
return upgrades;
|
return upgrades;
|
||||||
}
|
}
|
||||||
@@ -273,6 +278,10 @@ public class Control extends Module{
|
|||||||
@Override
|
@Override
|
||||||
public void update(){
|
public void update(){
|
||||||
|
|
||||||
|
if(error != null){
|
||||||
|
throw new RuntimeException(error);
|
||||||
|
}
|
||||||
|
|
||||||
if(Gdx.input != proxy){
|
if(Gdx.input != proxy){
|
||||||
Gdx.input = proxy;
|
Gdx.input = proxy;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -10,6 +10,7 @@ import io.anuke.ucore.entities.EntityGroup;
|
|||||||
import io.anuke.ucore.entities.EntityGroup.ArrayContainer;
|
import io.anuke.ucore.entities.EntityGroup.ArrayContainer;
|
||||||
import io.anuke.ucore.util.Log;
|
import io.anuke.ucore.util.Log;
|
||||||
|
|
||||||
|
import static io.anuke.mindustry.Vars.control;
|
||||||
import static io.anuke.mindustry.Vars.logic;
|
import static io.anuke.mindustry.Vars.logic;
|
||||||
|
|
||||||
public class ThreadHandler {
|
public class ThreadHandler {
|
||||||
@@ -119,10 +120,8 @@ public class ThreadHandler {
|
|||||||
}
|
}
|
||||||
} catch (InterruptedException ex) {
|
} catch (InterruptedException ex) {
|
||||||
Log.info("Stopping logic thread.");
|
Log.info("Stopping logic thread.");
|
||||||
} catch (Exception ex) {
|
} catch (Throwable ex) {
|
||||||
Timers.run(0f, () -> {
|
control.setError(ex);
|
||||||
throw new RuntimeException(ex);
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -99,6 +99,7 @@ public abstract class InputHandler extends InputAdapter{
|
|||||||
rect.setCenter(offset.x + x * tilesize, offset.y + y * tilesize);
|
rect.setCenter(offset.x + x * tilesize, offset.y + y * tilesize);
|
||||||
|
|
||||||
for(SolidEntity e : Entities.getNearby(enemyGroup, x * tilesize, y * tilesize, tilesize * 2f)){
|
for(SolidEntity e : Entities.getNearby(enemyGroup, x * tilesize, y * tilesize, tilesize * 2f)){
|
||||||
|
if(e == null) continue; //not sure why this happens?
|
||||||
Rectangle rect = e.hitbox.getRect(e.x, e.y);
|
Rectangle rect = e.hitbox.getRect(e.x, e.y);
|
||||||
|
|
||||||
if(this.rect.overlaps(rect)){
|
if(this.rect.overlaps(rect)){
|
||||||
|
|||||||
@@ -143,6 +143,7 @@ public class Conveyor extends Block{
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean acceptItem(Item item, Tile tile, Tile source){
|
public boolean acceptItem(Item item, Tile tile, Tile source){
|
||||||
|
if(tile.entity == null) return false;
|
||||||
int direction = source == null ? 0 : Math.abs(source.relativeTo(tile.x, tile.y) - tile.getRotation());
|
int direction = source == null ? 0 : Math.abs(source.relativeTo(tile.x, tile.y) - tile.getRotation());
|
||||||
float minitem = tile.<ConveyorEntity>entity().minitem;
|
float minitem = tile.<ConveyorEntity>entity().minitem;
|
||||||
return (((direction == 0) && minitem > 0.05f) ||
|
return (((direction == 0) && minitem > 0.05f) ||
|
||||||
|
|||||||
@@ -142,7 +142,7 @@ public class Teleporter extends PowerBlock{
|
|||||||
@Override
|
@Override
|
||||||
public boolean acceptItem(Item item, Tile tile, Tile source){
|
public boolean acceptItem(Item item, Tile tile, Tile source){
|
||||||
PowerEntity entity = tile.entity();
|
PowerEntity entity = tile.entity();
|
||||||
return entity.power >= powerPerItem && findLinks(tile, item).size > 0;
|
return !(source.block() instanceof Teleporter) && entity.power >= powerPerItem && findLinks(tile, item).size > 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
Executable
+3
@@ -0,0 +1,3 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
|
./gradlew server:dist
|
||||||
|
java -jar server/build/libs/server-release.jar
|
||||||
Reference in New Issue
Block a user