From d6664b9b5a9a3aab500b547e4d7448a8bc4ad416 Mon Sep 17 00:00:00 2001 From: Kai Stevenson Date: Sun, 23 Aug 2026 01:07:07 -0700 Subject: allow entity damage --- src/sim/cell/cell.rs | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) (limited to 'src/sim/cell/cell.rs') diff --git a/src/sim/cell/cell.rs b/src/sim/cell/cell.rs index be2cfad..5a9fc1f 100644 --- a/src/sim/cell/cell.rs +++ b/src/sim/cell/cell.rs @@ -8,8 +8,11 @@ pub struct Cell { } impl Cell { + // only update the cell if this matches the parity of the seqno const FLAG_PARITY: u8 = 0b0000_0001; - const FLAG_ENTITY: u8 = 0b0000_0010; + // is this cell owned by an entity? + const FLAG_ENTITY_INTEGRATED: u8 = 0b0000_0010; + // how close is the cell to settling? const MASK_SETTLED: u8 = 0b0001_1100; #[inline] @@ -31,15 +34,15 @@ impl Cell { } #[inline] - pub fn entity(self) -> bool { - (self.flags & Self::FLAG_ENTITY) == Self::FLAG_ENTITY + pub fn entity_integrated(self) -> bool { + (self.flags & Self::FLAG_ENTITY_INTEGRATED) == Self::FLAG_ENTITY_INTEGRATED } #[inline] - pub fn set_entity(&mut self, rb: bool) { - if rb { - self.flags |= Self::FLAG_ENTITY + pub fn set_entity_integrated(&mut self, entity_integrated: bool) { + if entity_integrated { + self.flags |= Self::FLAG_ENTITY_INTEGRATED } else { - self.flags &= !Self::FLAG_ENTITY + self.flags &= !Self::FLAG_ENTITY_INTEGRATED } } -- cgit v1.3.1