diff --git a/src/ship/items/manager.rs b/src/ship/items/manager.rs index 85723b6..4745907 100644 --- a/src/ship/items/manager.rs +++ b/src/ship/items/manager.rs @@ -1438,10 +1438,8 @@ impl ItemAction for TradeMeseta { weapon.increment_kill_counter(); entity_gateway.increment_kill_counter(&weapon_entity).await?; } - // limiter - for units in equipped_items.unit { - if let Some(unit_entity) = units { - let unit_id = inventory.get_item_by_entity_id(unit_entity).ok_or(ItemManagerError::EntityIdNotInInventory(unit_entity))?.item_id(); + 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))? @@ -1452,8 +1450,6 @@ impl ItemAction for TradeMeseta { .ok_or(ItemManagerError::WrongItemType(unit_id))?; unit.increment_kill_counter(); - entity_gateway.increment_kill_counter(&unit_entity).await?; - } } entity_gateway.set_character_inventory(&character.id, &inventory.as_inventory_entity(&character.id)).await?; Ok(())