An experimental, status effects-as-entities system for Bevy.
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

Merge pull request #2 from AlephCubed/clippy

Fix clippy issues.

authored by

Josiah Nelson and committed by
GitHub
e1455c74 396c455b

+7 -9
+7 -9
src/command.rs
··· 87 87 .components() 88 88 .get_info(*component_id) 89 89 .and_then(|info| info.type_id()) 90 - .and_then(|id| registry.merges.get(&id).map(|f| *f)) 90 + .and_then(|id| registry.merges.get(&id).copied()) 91 91 }) 92 92 .collect(); 93 93 ··· 101 101 } 102 102 103 103 impl<B: Bundle> Command for AddEffectCommand<B> { 104 - fn apply(self, world: &mut World) -> () { 104 + fn apply(self, world: &mut World) { 105 105 if self.bundle.mode == EffectMode::Stack { 106 106 self.spawn(world); 107 107 return; ··· 119 119 // 1. effecting the same target, 120 120 // 2. and has the same name (ID). 121 121 let old_entity = effected_by.iter().find_map(|entity| { 122 - let Some(other_mode) = world.get::<EffectMode>(*entity) else { 123 - return None; 124 - }; 122 + let other_mode = world.get::<EffectMode>(*entity)?; 125 123 126 124 // Todo Think more about. 127 125 if self.bundle.mode != *other_mode { 128 126 return None; 129 127 } 130 128 131 - if let Some(name) = world.get::<Name>(*entity) { 132 - if name == &self.bundle.name { 133 - return Some(*entity); 134 - } 129 + let name = world.get::<Name>(*entity)?; 130 + 131 + if name == &self.bundle.name { 132 + return Some(*entity); 135 133 } 136 134 137 135 None