diff --git a/src/fot/entitylist.rs b/src/fot/entitylist.rs index b177fba..33e7d84 100644 --- a/src/fot/entitylist.rs +++ b/src/fot/entitylist.rs @@ -178,3 +178,12 @@ impl<'a> IntoIterator for &'a EntityList { (1..).zip(&self.ents) } } + +impl<'a> IntoIterator for &'a mut EntityList { + type Item = (usize, &'a mut Entity); + type IntoIter = std::iter::Zip, std::slice::IterMut<'a, Entity>>; + + fn into_iter(self) -> Self::IntoIter { + (1..).zip(&mut self.ents) + } +} diff --git a/src/fot/world.rs b/src/fot/world.rs index d17bcf6..ca8cc2d 100644 --- a/src/fot/world.rs +++ b/src/fot/world.rs @@ -32,6 +32,10 @@ impl World { pub fn test(&mut self) -> Result<(), FE> { //let actor_type = self.entlist.get_type_idx("Actor").unwrap(); //let ent = self.entlist.get_entity_mut(2122); + for (id, ent) in &mut self.entlist { + ent.flags = 1; + } + let ent = self.entlist.get_entity_mut(2158); let esh = ent.get_esh()?; for (name, value) in &esh.props {