Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make indestructible blocks not allow pathfinding and still be breakable #10525

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion core/src/mindustry/world/Block.java
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ public class Block extends UnlockableContent implements Senseable{
/** for static blocks only: if true, tile data() is saved in world data. */
public boolean saveData;
/** whether you can break this with rightclick */
public boolean breakable;
public boolean breakable = true;
/** if true, this block will be broken by certain units stepping/moving over it */
public boolean unitMoveBreakable;
/** whether to add this block to brokenblocks */
Expand Down
6 changes: 3 additions & 3 deletions core/src/mindustry/world/Tile.java
Original file line number Diff line number Diff line change
Expand Up @@ -416,20 +416,20 @@ public void clearOverlay(){
}

public boolean passable(){
return !((floor.solid && (block == Blocks.air || block.solidifes)) || (block.solid && (!block.destructible && !block.update)));
return !((floor.solid && (block == Blocks.air || block.solidifes)) || (block.solid && (!block.destructible)));
}

/** Whether this block was placed by a player/unit. */
public boolean synthetic(){
return block.update || block.destructible;
return block.update || block.destructible || block.breakable;
}

public boolean solid(){
return block.solid || floor.solid || (build != null && build.checkSolid());
}

public boolean breakable(){
return block.destructible || block.breakable || block.update;
return block.breakable;
}

/** @return whether the floor on this tile deals damage or can be drowned on. */
Expand Down