Fix ridiculous tunnel loop crash
This commit is contained in:
@@ -34,7 +34,7 @@ public class Vars{
|
|||||||
//save file directory
|
//save file directory
|
||||||
public static final FileHandle saveDirectory = Gdx.files.local("mindustry-saves/");
|
public static final FileHandle saveDirectory = Gdx.files.local("mindustry-saves/");
|
||||||
//scale of the font
|
//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
|
//camera zoom displayed on startup
|
||||||
public static final int baseCameraScale = Math.round(Unit.dp.inPixels(4));
|
public static final int baseCameraScale = Math.round(Unit.dp.inPixels(4));
|
||||||
//how much the zoom changes every zoom button press
|
//how much the zoom changes every zoom button press
|
||||||
|
|||||||
@@ -75,17 +75,12 @@ public class MapEditor{
|
|||||||
int y = dy - dstHeight/2;
|
int y = dy - dstHeight/2;
|
||||||
|
|
||||||
if (x + dstWidth > width){
|
if (x + dstWidth > width){
|
||||||
//x = width - dstWidth;
|
x = width - dstWidth;
|
||||||
dstWidth = width - x;
|
|
||||||
}else if (x < 0){
|
}else if (x < 0){
|
||||||
dstWidth += x;
|
|
||||||
x = 0;
|
x = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
//System.out.println(x + " " + y + " " + dstWidth + " " + dstHeight);
|
|
||||||
|
|
||||||
if (y + dstHeight > height){
|
if (y + dstHeight > height){
|
||||||
//y = height - dstHeight;
|
|
||||||
dstHeight = height - y;
|
dstHeight = height - y;
|
||||||
}else if (y < 0){
|
}else if (y < 0){
|
||||||
dstHeight += y;
|
dstHeight += y;
|
||||||
|
|||||||
@@ -0,0 +1,5 @@
|
|||||||
|
package io.anuke.mindustry.mapeditor;
|
||||||
|
|
||||||
|
public class MapGenerateDialog{
|
||||||
|
|
||||||
|
}
|
||||||
@@ -13,6 +13,7 @@ public class TunnelConveyor extends Block{
|
|||||||
rotate = true;
|
rotate = true;
|
||||||
update = true;
|
update = true;
|
||||||
solid = true;
|
solid = true;
|
||||||
|
health = 70;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -38,7 +39,7 @@ public class TunnelConveyor extends Block{
|
|||||||
Tile tunnel = getDestTunnel(dest);
|
Tile tunnel = getDestTunnel(dest);
|
||||||
if(tunnel != null){
|
if(tunnel != null){
|
||||||
Tile to = tunnel.getNearby()[tunnel.getRotation()];
|
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{
|
}else{
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user