|
@ -539,7 +539,7 @@ impl ItemManager { |
|
|
let inventory = self.character_inventory.get_mut(&character.id).ok_or(ItemManagerError::NoCharacter(character.id))?;
|
|
|
let inventory = self.character_inventory.get_mut(&character.id).ok_or(ItemManagerError::NoCharacter(character.id))?;
|
|
|
let used_item = inventory.get_item_handle_by_id(item_id).ok_or(ItemManagerError::NoSuchItemId(item_id))?;
|
|
|
let used_item = inventory.get_item_handle_by_id(item_id).ok_or(ItemManagerError::NoSuchItemId(item_id))?;
|
|
|
let consumed_item = used_item.consume(amount)?;
|
|
|
let consumed_item = used_item.consume(amount)?;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if let ItemDetail::TechniqueDisk(tech_disk) = consumed_item.item() {
|
|
|
if let ItemDetail::TechniqueDisk(tech_disk) = consumed_item.item() {
|
|
|
// TODO: validate tech level in packet is in bounds [1..30]
|
|
|
// TODO: validate tech level in packet is in bounds [1..30]
|
|
|
character.techs.set_tech(tech_disk.tech, TechLevel(tech_disk.level as u8));
|
|
|
character.techs.set_tech(tech_disk.tech, TechLevel(tech_disk.level as u8));
|
|
|