Browse Source

I am dumb

pull/112/head
jake 2 years ago
committed by andy
parent
commit
b473af7680
  1. 3
      src/ship/items/actions.rs
  2. 4
      tests/test_item_actions.rs

3
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<dyn EntityGatewayTransaction + 'a>), ())
-> Pin<Box<dyn Future<Output=Result<((ItemStateProxy<'a>, Box<dyn EntityGatewayTransaction + 'a>), ()), 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), ()))
})

4
tests/test_item_actions.rs

@ -47,8 +47,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,

Loading…
Cancel
Save