From 48c24ec8b011d081550dc78329cbe61de67b30e9 Mon Sep 17 00:00:00 2001 From: troido Date: Sun, 5 Apr 2020 20:04:33 +0200 Subject: items are now mostly replaced by itemids, with a mapping to the item in the encyclopedia --- src/systems/useitem.rs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'src/systems/useitem.rs') diff --git a/src/systems/useitem.rs b/src/systems/useitem.rs index 8763843..605f083 100644 --- a/src/systems/useitem.rs +++ b/src/systems/useitem.rs @@ -21,7 +21,7 @@ use crate::{ Flags }, resources::{NewEntities, Ground}, - components::item::ItemAction::{None, Build, Eat, Equip}, + item::ItemAction::{None, Build, Eat, Equip}, controls::Control, }; @@ -44,7 +44,7 @@ impl <'a> System<'a> for Use { match &controller.control { Control::Use(rank) => { if let Some(entry) = inventory.items.get_mut(*rank) { - match &entry.0.action { + match &entry.item.action { Build(template, required_flags, blocking_flags) => { let ground_flags = ground.flags_on(position.pos, &flags); if required_flags.is_subset(&ground_flags) && blocking_flags.is_disjoint(&ground_flags){ @@ -59,13 +59,13 @@ impl <'a> System<'a> for Use { Equip(equippable) => { let slot = equippable.slot; for otherentry in inventory.items.iter_mut() { - if let Equip(other) = &otherentry.0.action { + if let Equip(other) = &otherentry.item.action { if other.slot == slot { - otherentry.1 = false; + otherentry.is_equipped = false; } } } - inventory.items[*rank].1 = true; + inventory.items[*rank].is_equipped = true; } None => {} } -- cgit