Fix ridiculous tunnel loop crash

This commit is contained in:
Anuken 2017-12-18 00:11:47 -05:00
parent 1a8fdda421
commit 1ae875ebf4
4 changed files with 9 additions and 8 deletions

View file

@ -34,7 +34,7 @@ public class Vars{
//save file directory
public static final FileHandle saveDirectory = Gdx.files.local("mindustry-saves/");
//scale of the font
public static float fontscale = Unit.dp.inPixels(1f)/2f;
public static float fontscale = Math.max(Unit.dp.inPixels(1f)/2f, 0.5f);
//camera zoom displayed on startup
public static final int baseCameraScale = Math.round(Unit.dp.inPixels(4));
//how much the zoom changes every zoom button press

View file

@ -75,17 +75,12 @@ public class MapEditor{
int y = dy - dstHeight/2;
if (x + dstWidth > width){
//x = width - dstWidth;
dstWidth = width - x;
x = width - dstWidth;
}else if (x < 0){
dstWidth += x;
x = 0;
}
//System.out.println(x + " " + y + " " + dstWidth + " " + dstHeight);
if (y + dstHeight > height){
//y = height - dstHeight;
dstHeight = height - y;
}else if (y < 0){
dstHeight += y;

View file

@ -0,0 +1,5 @@
package io.anuke.mindustry.mapeditor;
public class MapGenerateDialog{
}

View file

@ -13,6 +13,7 @@ public class TunnelConveyor extends Block{
rotate = true;
update = true;
solid = true;
health = 70;
}
@Override
@ -38,7 +39,7 @@ public class TunnelConveyor extends Block{
Tile tunnel = getDestTunnel(dest);
if(tunnel != null){
Tile to = tunnel.getNearby()[tunnel.getRotation()];
return to != null && to.block().acceptItem(item, to, tunnel);
return to != null && !(to.block() instanceof TunnelConveyor) && to.block().acceptItem(item, to, tunnel);
}else{
return false;
}