Browse Source

andy vs. clippy round 5

kill_counters
andy 3 years ago
parent
commit
3eeee323a9
  1. 8
      src/ship/items/manager.rs

8
src/ship/items/manager.rs

@ -1438,10 +1438,8 @@ impl<EG: EntityGateway> ItemAction<EG> 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<EG: EntityGateway> ItemAction<EG> 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(())

Loading…
Cancel
Save