Ground units: Avoid stepping onto dangerous/deep floor
This commit is contained in:
@@ -378,6 +378,11 @@ public class Tile implements Position, QuadTreeObject, Displayable{
|
||||
return block.destructible || block.breakable || block.update;
|
||||
}
|
||||
|
||||
/** @return whether the floor on this tile deals damage or can be drowned on. */
|
||||
public boolean dangerous(){
|
||||
return !block.solid && (floor.isDeep() || floor.damageTaken > 0);
|
||||
}
|
||||
|
||||
/**
|
||||
* Iterates through the list of all tiles linked to this multiblock, or just itself if it's not a multiblock.
|
||||
* The result contains all linked tiles, including this tile itself.
|
||||
|
||||
Reference in New Issue
Block a user