summaryrefslogtreecommitdiff
path: root/src/systems
diff options
context:
space:
mode:
authortroido <troido@protonmail.com>2020-02-10 11:55:20 +0100
committertroido <troido@protonmail.com>2020-02-10 11:55:20 +0100
commitf6d1d4ea258490670ee1605c596a6ba9a49a77db (patch)
treedae5da3c0a5db2630a81999ffc298797082618ac /src/systems
parentb0e665f5436e08e4fd7446a59b87ac28f562a601 (diff)
inventories have capacity
Diffstat (limited to 'src/systems')
-rw-r--r--src/systems/take.rs2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/systems/take.rs b/src/systems/take.rs
index 95bec1b..f0e3990 100644
--- a/src/systems/take.rs
+++ b/src/systems/take.rs
@@ -41,7 +41,7 @@ impl <'a> System<'a> for Take {
fn run(&mut self, (entities, controllers, positions, ground, mut removed, items, mut inventories, mut new): Self::SystemData) {
for (ent, controller, position, inventory) in (&entities, &controllers, &positions, &mut inventories).join(){
match &controller.0 {
- Control::Take(_rank) => {
+ Control::Take(_rank) if inventory.items.len() < inventory.capacity => {
let mut ents = ground.cells.get(&position.pos).unwrap_or(&HashSet::new()).clone();
ents.remove(&ent);
for ent in ents {