diff --git a/core/assets/bundles/bundle.properties b/core/assets/bundles/bundle.properties index da6d2fd02f..75791d8488 100644 --- a/core/assets/bundles/bundle.properties +++ b/core/assets/bundles/bundle.properties @@ -2321,7 +2321,7 @@ lenum.payenter = Enter/land on the payload block the unit is on. lenum.flag = Numeric unit flag. lenum.mine = Mine at a position. lenum.build = Build a structure. -lenum.getblock = Fetch a building and type at coordinates.\nUnit must be in range of position.\nSolid non-buildings will have the type [accent]@solid[]. +lenum.getblock = Fetch a building, floor and type at coordinates.\nUnit must be in range of position.\nSolid non-buildings will have the type [accent]@solid[]. lenum.within = Check if unit is near a position. lenum.boost = Start/stop boosting. diff --git a/core/src/mindustry/logic/LExecutor.java b/core/src/mindustry/logic/LExecutor.java index 87ec7ddda5..a4cbe5171f 100644 --- a/core/src/mindustry/logic/LExecutor.java +++ b/core/src/mindustry/logic/LExecutor.java @@ -510,12 +510,21 @@ public class LExecutor{ if(!unit.within(x1, y1, range)){ exec.setobj(p3, null); exec.setobj(p4, null); + exec.setobj(p5, null); }else{ Tile tile = world.tileWorld(x1, y1); - //any environmental solid block is returned as StoneWall, aka "@solid" - Block block = tile == null ? null : !tile.synthetic() ? (tile.solid() ? Blocks.stoneWall : Blocks.air) : tile.block(); - exec.setobj(p3, block); - exec.setobj(p4, tile != null && tile.build != null ? tile.build : null); + if(tile == null){ + exec.setobj(p3, null); + exec.setobj(p4, null); + exec.setobj(p5, null); + }else{ + //any environmental solid block is returned as StoneWall, aka "@solid" + Block block = !tile.synthetic() ? (tile.solid() ? Blocks.stoneWall : Blocks.air) : tile.block(); + exec.setobj(p3, block); + exec.setobj(p4, tile.build != null ? tile.build : null); + //Allows reading of ore tiles if they are present (overlay is not air) otherwise returns the floor + exec.setobj(p5, tile.overlay() == Blocks.air ? tile.floor() : tile.overlay()); + } } } case itemDrop -> { diff --git a/core/src/mindustry/logic/LUnitControl.java b/core/src/mindustry/logic/LUnitControl.java index fd7606e104..1ff56c2a44 100644 --- a/core/src/mindustry/logic/LUnitControl.java +++ b/core/src/mindustry/logic/LUnitControl.java @@ -16,7 +16,7 @@ public enum LUnitControl{ mine("x", "y"), flag("value"), build("x", "y", "block", "rotation", "config"), - getBlock("x", "y", "type", "building"), + getBlock("x", "y", "type", "building", "floor"), within("x", "y", "radius", "result"), unbind;