mirror of
https://github.com/Anuken/Mindustry.git
synced 2026-01-27 23:11:12 -08:00
Fix ridiculous tunnel loop crash
This commit is contained in:
parent
1a8fdda421
commit
1ae875ebf4
4 changed files with 9 additions and 8 deletions
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -0,0 +1,5 @@
|
|||
package io.anuke.mindustry.mapeditor;
|
||||
|
||||
public class MapGenerateDialog{
|
||||
|
||||
}
|
||||
|
|
@ -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;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue