From 883370db3906697d30533c2eaba1616ab1fe4f19 Mon Sep 17 00:00:00 2001 From: jake Date: Sun, 15 May 2022 00:55:09 -0600 Subject: [PATCH] I am dumb --- src/ship/items/actions.rs | 3 ++- tests/test_item_actions.rs | 4 ++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/ship/items/actions.rs b/src/ship/items/actions.rs index 2b3f815..4decfa8 100644 --- a/src/ship/items/actions.rs +++ b/src/ship/items/actions.rs @@ -494,6 +494,7 @@ fn equip_inventory_item(character_id: CharacterEntityId, item_id: ClientItemId, let mut inventory = item_state.inventory(&character_id)?; inventory.equip(&item_id, equip_slot); transaction.gateway().set_character_equips(&character_id, &inventory.as_equipped_entity()).await?; + item_state.set_inventory(inventory); Ok(((item_state, transaction), ())) }) @@ -522,7 +523,6 @@ where } - fn unequip_inventory_item(character_id: CharacterEntityId, item_id: ClientItemId) -> impl for<'a> Fn((ItemStateProxy<'a>, Box), ()) -> Pin, Box), ()), ItemStateError>> + Send + 'a>> @@ -532,6 +532,7 @@ fn unequip_inventory_item(character_id: CharacterEntityId, item_id: ClientItemId let mut inventory = item_state.inventory(&character_id)?; inventory.unequip(&item_id); transaction.gateway().set_character_equips(&character_id, &inventory.as_equipped_entity()).await?; + item_state.set_inventory(inventory); Ok(((item_state, transaction), ())) }) diff --git a/tests/test_item_actions.rs b/tests/test_item_actions.rs index c8776a8..ba2e4f2 100644 --- a/tests/test_item_actions.rs +++ b/tests/test_item_actions.rs @@ -49,8 +49,8 @@ async fn test_equip_unit_from_equip_menu() { }).await.unwrap()); let equipped = item::EquippedEntity { - weapon: Some(p1_inv[0].id), - armor: None, + weapon: None, + armor: Some(p1_inv[0].id), shield: None, unit: [None; 4], mag: None,