This commit is contained in:
Anuken 2024-10-31 22:32:32 -04:00
parent 2a7e564603
commit 8e6010ad8c

View File

@ -1996,7 +1996,7 @@ public abstract class InputHandler implements InputProcessor, GestureListener{
}
public boolean validPlace(int x, int y, Block type, int rotation, @Nullable BuildPlan ignore, boolean ignoreUnits){
if(player.unit().plans.size > 0){
if(player.isBuilder() && player.unit().plans.size > 0){
Tmp.r1.setCentered(x * tilesize + type.offset, y * tilesize + type.offset, type.size * tilesize);
plansOut.clear();
playerPlanTree.intersect(Tmp.r1, plansOut);
@ -2020,6 +2020,8 @@ public abstract class InputHandler implements InputProcessor, GestureListener{
}
public void breakBlock(int x, int y){
if(!player.isBuilder()) return;
Tile tile = world.tile(x, y);
if(tile != null && tile.build != null) tile = tile.build.tile;
player.unit().addBuild(new BuildPlan(tile.x, tile.y));