diff --git a/core/src/mindustry/world/Build.java b/core/src/mindustry/world/Build.java index 03a3db970b..bbc38dbdd4 100644 --- a/core/src/mindustry/world/Build.java +++ b/core/src/mindustry/world/Build.java @@ -198,16 +198,17 @@ public class Build{ if(tile == null) return false; + //floors have different checks + if(type.isFloor()){ + return type.isOverlay() ? tile.overlay() != type : tile.floor() != type; + } + //campaign darkness check if(world.getDarkness(x, y) >= 3){ return false; } - if(!type.requiresWater && !type.isFloor() && !contactsShallows(tile.x, tile.y, type) && !type.placeableLiquid){ - return false; - } - - if((type.isFloor() && tile.floor() == type) || (type.isOverlay() && tile.overlay() == type)){ + if(!type.requiresWater && !contactsShallows(tile.x, tile.y, type) && !type.placeableLiquid){ return false; } @@ -231,7 +232,7 @@ public class Build{ (check.floor().isDeep() && !type.floating && !type.requiresWater && !type.placeableLiquid) || //deep water (type == check.block() && check.build != null && rotation == check.build.rotation && type.rotate && !((type == check.block && check.team() == Team.derelict))) || //same block, same rotation !check.interactable(team) || //cannot interact - (!check.floor().placeableOn && !type.isFloor()) || //solid floor + !check.floor().placeableOn || //solid floor (!checkVisible && !check.block().alwaysReplace) || //replacing a block that should be replaced (e.g. payload placement) !(((type.canReplace(check.block()) || (type == check.block && state.rules.derelictRepair && check.team() == Team.derelict)) || //can replace type OR can replace derelict block of same type (check.build instanceof ConstructBuild build && build.current == type && check.centerX() == tile.x && check.centerY() == tile.y)) && //same type in construction diff --git a/core/src/mindustry/world/blocks/ConstructBlock.java b/core/src/mindustry/world/blocks/ConstructBlock.java index 9e4ac3e719..df7434a222 100644 --- a/core/src/mindustry/world/blocks/ConstructBlock.java +++ b/core/src/mindustry/world/blocks/ConstructBlock.java @@ -75,10 +75,8 @@ public class ConstructBlock extends Block{ if(block instanceof OverlayFloor overlay){ tile.setOverlay(overlay); - tile.setBlock(Blocks.air); }else if(block instanceof Floor floor){ tile.setFloorUnder(floor); - tile.setBlock(Blocks.air); }else{ tile.setBlock(block, team, rotation); }