|
@ -494,6 +494,7 @@ fn equip_inventory_item(character_id: CharacterEntityId, item_id: ClientItemId, |
|
|
let mut inventory = item_state.inventory(&character_id)?;
|
|
|
let mut inventory = item_state.inventory(&character_id)?;
|
|
|
inventory.equip(&item_id, equip_slot);
|
|
|
inventory.equip(&item_id, equip_slot);
|
|
|
transaction.gateway().set_character_equips(&character_id, &inventory.as_equipped_entity()).await?;
|
|
|
transaction.gateway().set_character_equips(&character_id, &inventory.as_equipped_entity()).await?;
|
|
|
|
|
|
item_state.set_inventory(inventory);
|
|
|
|
|
|
|
|
|
Ok(((item_state, transaction), ()))
|
|
|
Ok(((item_state, transaction), ()))
|
|
|
})
|
|
|
})
|
|
@ -522,7 +523,6 @@ where |
|
|
}
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
fn unequip_inventory_item(character_id: CharacterEntityId, item_id: ClientItemId)
|
|
|
fn unequip_inventory_item(character_id: CharacterEntityId, item_id: ClientItemId)
|
|
|
-> impl for<'a> Fn((ItemStateProxy<'a>, Box<dyn EntityGatewayTransaction + 'a>), ())
|
|
|
-> 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>>
|
|
|
-> 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)?;
|
|
|
let mut inventory = item_state.inventory(&character_id)?;
|
|
|
inventory.unequip(&item_id);
|
|
|
inventory.unequip(&item_id);
|
|
|
transaction.gateway().set_character_equips(&character_id, &inventory.as_equipped_entity()).await?;
|
|
|
transaction.gateway().set_character_equips(&character_id, &inventory.as_equipped_entity()).await?;
|
|
|
|
|
|
item_state.set_inventory(inventory);
|
|
|
|
|
|
|
|
|
Ok(((item_state, transaction), ()))
|
|
|
Ok(((item_state, transaction), ()))
|
|
|
})
|
|
|
})
|
|
|