diff options
| author | troido <troido@protonmail.com> | 2020-09-22 15:36:58 +0200 |
|---|---|---|
| committer | troido <troido@protonmail.com> | 2020-09-22 15:36:58 +0200 |
| commit | 37ad98cf725aa22f1c793b66102c99c9a76a4ec2 (patch) | |
| tree | a1f35b025abb36b48c7646e84af76c05fcfac3cf /src/systems/take.rs | |
| parent | 33c1054d528efd896415baf08d4a52e1cdd7b801 (diff) | |
can base sprite on equipped items
Diffstat (limited to 'src/systems/take.rs')
| -rw-r--r-- | src/systems/take.rs | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/systems/take.rs b/src/systems/take.rs index eedb83c..b055220 100644 --- a/src/systems/take.rs +++ b/src/systems/take.rs @@ -6,7 +6,8 @@ use specs::{ WriteStorage, System, Join, - Write + Write, + Entity }; use crate::components::{ @@ -41,7 +42,7 @@ impl <'a> System<'a> for Take { for (ent, controller, position, inventory) in (&entities, &controllers, &positions, &mut inventories).join(){ match &controller.control { Control::Take(rank) if inventory.items.len() < inventory.capacity => { - let mut ents = ground.by_height(&position.pos, &visibles, &ent); + let mut ents: Vec<Entity> = ground.by_height(&position.pos, &visibles).into_iter().filter(|e| *e != ent).collect(); if let Some(idx) = rank { if *idx >= ents.len() { return |
