This commit is contained in:
Anuken
2024-02-13 21:22:07 -05:00
parent 00ecf37276
commit 1ab8b50977
3 changed files with 16 additions and 2 deletions

View File

@@ -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);
}