mirror of
https://github.com/Anuken/Mindustry.git
synced 2025-02-07 01:18:26 +07:00
Fixed #9548
This commit is contained in:
parent
00ecf37276
commit
1ab8b50977
@ -301,6 +301,14 @@ public class MapEditor{
|
||||
if(previous.in(px, py)){
|
||||
tiles.set(x, y, previous.getn(px, py));
|
||||
Tile tile = tiles.getn(x, y);
|
||||
|
||||
Object config = null;
|
||||
|
||||
//fetch the old config first, configs can be relative to block position (tileX/tileY) before those are reassigned
|
||||
if(tile.build != null && tile.isCenter()){
|
||||
config = tile.build.config();
|
||||
}
|
||||
|
||||
tile.x = (short)x;
|
||||
tile.y = (short)y;
|
||||
|
||||
@ -309,9 +317,12 @@ public class MapEditor{
|
||||
tile.build.y = y * tilesize + tile.block().offset;
|
||||
|
||||
//shift links to account for map resize
|
||||
Object config = tile.build.config();
|
||||
if(config != null){
|
||||
Object out = BuildPlan.pointConfig(tile.block(), config, p -> p.sub(offsetX, offsetY));
|
||||
Object out = BuildPlan.pointConfig(tile.block(), config, p -> {
|
||||
if(!tile.build.block.ignoreResizeConfig){
|
||||
p.sub(offsetX, offsetY);
|
||||
}
|
||||
});
|
||||
if(out != config){
|
||||
tile.build.configureAny(out);
|
||||
}
|
||||
|
@ -219,6 +219,8 @@ public class Block extends UnlockableContent implements Senseable{
|
||||
public int unitCapModifier = 0;
|
||||
/** Whether the block can be tapped and selected to configure. */
|
||||
public boolean configurable;
|
||||
/** If true, this block does not have pointConfig with a transform called on map resize. */
|
||||
public boolean ignoreResizeConfig;
|
||||
/** If true, this building can be selected like a unit when commanding. */
|
||||
public boolean commandable;
|
||||
/** If true, the building inventory can be shown with the config. */
|
||||
|
@ -45,6 +45,7 @@ public class LogicBlock extends Block{
|
||||
configurable = true;
|
||||
group = BlockGroup.logic;
|
||||
schematicPriority = 5;
|
||||
ignoreResizeConfig = true;
|
||||
|
||||
//universal, no real requirements
|
||||
envEnabled = Env.any;
|
||||
|
Loading…
Reference in New Issue
Block a user