summaryrefslogtreecommitdiff
path: root/src/sim/cell_sim/chunk.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/sim/cell_sim/chunk.rs')
-rw-r--r--src/sim/cell_sim/chunk.rs9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/sim/cell_sim/chunk.rs b/src/sim/cell_sim/chunk.rs
index c7d619b..85d2c09 100644
--- a/src/sim/cell_sim/chunk.rs
+++ b/src/sim/cell_sim/chunk.rs
@@ -1,7 +1,10 @@
use crate::{
config::{CELLS_IN_CHUNK, CHUNK_SIZE},
sim::{
- cell::{cell::Cell, materials::MaterialId},
+ cell::{
+ cell::Cell,
+ materials::{MaterialForm, MaterialId},
+ },
lib::marching_squares::Marchable,
},
};
@@ -36,7 +39,9 @@ impl Marchable for Chunk {
if x < 0 || x >= CHUNK_SIZE || y < 0 || y >= CHUNK_SIZE {
false
} else {
- self.get_cell_at_local_position(x as u8, y as u8).material != MaterialId::Void
+ // we only build a path for solid cells or settled powder cells
+ let cell = self.get_cell_at_local_position(x as u8, y as u8);
+ cell.material.def().form == MaterialForm::Solid || cell.settled() > 4
}
}
fn size(&self) -> (i32, i32) {