Anuken/Mindustry-Suggestions/issues/548
This commit is contained in:
@@ -78,7 +78,6 @@ public class Saves{
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void update(){
|
public void update(){
|
||||||
SaveSlot current = this.current;
|
|
||||||
|
|
||||||
if(current != null && state.isGame()
|
if(current != null && state.isGame()
|
||||||
&& !(state.isPaused() && Core.scene.hasDialog())){
|
&& !(state.isPaused() && Core.scene.hasDialog())){
|
||||||
@@ -93,14 +92,13 @@ public class Saves{
|
|||||||
if(time > Core.settings.getInt("saveinterval") * 60){
|
if(time > Core.settings.getInt("saveinterval") * 60){
|
||||||
saving = true;
|
saving = true;
|
||||||
|
|
||||||
Time.runTask(2f, () -> {
|
try{
|
||||||
try{
|
current.save();
|
||||||
current.save();
|
}catch(Throwable e){
|
||||||
}catch(Throwable e){
|
e.printStackTrace();
|
||||||
e.printStackTrace();
|
}
|
||||||
}
|
|
||||||
saving = false;
|
Time.runTask(3f, () -> saving = false);
|
||||||
});
|
|
||||||
|
|
||||||
time = 0;
|
time = 0;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -59,7 +59,7 @@ public class Build{
|
|||||||
result.beforePlaceBegan(tile, previous);
|
result.beforePlaceBegan(tile, previous);
|
||||||
|
|
||||||
tile.setBlock(sub, team, rotation);
|
tile.setBlock(sub, team, rotation);
|
||||||
tile.<ConstructBuild>bc().setConstruct(previous, result);
|
tile.<ConstructBuild>bc().setConstruct(previous.size == sub.size ? previous : Blocks.air, result);
|
||||||
|
|
||||||
result.placeBegan(tile, previous);
|
result.placeBegan(tile, previous);
|
||||||
|
|
||||||
@@ -91,7 +91,7 @@ public class Build{
|
|||||||
}
|
}
|
||||||
|
|
||||||
if(type.isMultiblock()){
|
if(type.isMultiblock()){
|
||||||
if((type.canReplace(tile.block()) || (tile.block instanceof ConstructBlock && tile.<ConstructBuild>bc().cblock == type)) &&
|
if(((type.canReplace(tile.block()) || tile.block.alwaysReplace) || (tile.block instanceof ConstructBlock && tile.<ConstructBuild>bc().cblock == type)) &&
|
||||||
type.canPlaceOn(tile, team) && tile.interactable(team)){
|
type.canPlaceOn(tile, team) && tile.interactable(team)){
|
||||||
|
|
||||||
//if the block can be replaced but the sizes differ, check all the spaces around the block to make sure it can fit
|
//if the block can be replaced but the sizes differ, check all the spaces around the block to make sure it can fit
|
||||||
@@ -105,7 +105,7 @@ public class Build{
|
|||||||
int wx = dx + offsetx + x, wy = dy + offsety + y;
|
int wx = dx + offsetx + x, wy = dy + offsety + y;
|
||||||
|
|
||||||
Tile check = world.tile(wx, wy);
|
Tile check = world.tile(wx, wy);
|
||||||
if(check == null || (!check.block.alwaysReplace && check.block != tile.block)) return false;
|
if(check == null || (!check.block.alwaysReplace && check.block != tile.block && !(check.block.size == 1 && type.canReplace(check.block)))) return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -55,7 +55,7 @@ public class Wall extends Block{
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean canReplace(Block other){
|
public boolean canReplace(Block other){
|
||||||
return super.canReplace(other) && health > other.health && size == other.size;
|
return (other != this || rotate) && this.group != BlockGroup.none && other.group == this.group && health > other.health && size >= other.size;
|
||||||
}
|
}
|
||||||
|
|
||||||
public class WallBuild extends Building{
|
public class WallBuild extends Building{
|
||||||
|
|||||||
Reference in New Issue
Block a user