|
|
@ -1203,18 +1203,7 @@ impl ItemManager { |
|
|
|
entity_gateway.add_weapon_modifier(&weapon_entity, wmodifier).await?;
|
|
|
|
}
|
|
|
|
for units in equipped_items.unit.iter().flatten() {
|
|
|
|
let unit_id = inventory.get_item_by_entity_id(*units).ok_or(ItemManagerError::EntityIdNotInInventory(*units))?.item_id();
|
|
|
|
let mut unit_handle = inventory.get_item_handle_by_id(unit_id).ok_or(ItemManagerError::NoSuchItemId(unit_id))?;
|
|
|
|
let individual_item_u = unit_handle.item_mut()
|
|
|
|
.ok_or(ItemManagerError::NoSuchItemId(unit_id))?
|
|
|
|
.individual_mut()
|
|
|
|
.ok_or(ItemManagerError::WrongItemType(unit_id))?;
|
|
|
|
let unit = individual_item_u
|
|
|
|
.unit_mut()
|
|
|
|
.ok_or(ItemManagerError::WrongItemType(unit_id))?;
|
|
|
|
|
|
|
|
let umodifier = UnitModifier::AddKill { enemy: monstertype };
|
|
|
|
unit.apply_modifier(&umodifier);
|
|
|
|
entity_gateway.add_unit_modifier(units, umodifier).await?;
|
|
|
|
}
|
|
|
|
entity_gateway.set_character_inventory(&character.id, &inventory.as_inventory_entity(&character.id)).await?;
|
|
|
|