Browse Source

andypls

pbs
andy 4 years ago
parent
commit
a95bcf35c8
  1. 18
      src/ship/items/inventory.rs

18
src/ship/items/inventory.rs

@ -408,7 +408,11 @@ impl CharacterInventory {
let (slot, _) = self.items.iter() let (slot, _) = self.items.iter()
.enumerate() .enumerate()
.filter(|(_, item)| { .filter(|(_, item)| {
if let InventoryItem::Individual(individual_inventory_item) = item {if let ItemDetail::Mag(_) = &individual_inventory_item.item {return individual_inventory_item.equipped }}
if let InventoryItem::Individual(individual_inventory_item) = item {
if let ItemDetail::Mag(_) = &individual_inventory_item.item {
return individual_inventory_item.equipped
}
}
false false
}) })
.nth(0)?; .nth(0)?;
@ -440,7 +444,11 @@ impl CharacterInventory {
let (slot, _) = self.items.iter() let (slot, _) = self.items.iter()
.enumerate() .enumerate()
.filter(|(_, item)| { .filter(|(_, item)| {
if let InventoryItem::Individual(individual_inventory_item) = item {if let ItemDetail::Shield(_) = &individual_inventory_item.item {return individual_inventory_item.equipped }}
if let InventoryItem::Individual(individual_inventory_item) = item {
if let ItemDetail::Shield(_) = &individual_inventory_item.item {
return individual_inventory_item.equipped
}
}
false false
}) })
.nth(0)?; .nth(0)?;
@ -454,7 +462,11 @@ impl CharacterInventory {
let (slot, _) = self.items.iter() let (slot, _) = self.items.iter()
.enumerate() .enumerate()
.filter(|(_, item)| { .filter(|(_, item)| {
if let InventoryItem::Individual(individual_inventory_item) = item {if let ItemDetail::Weapon(_) = &individual_inventory_item.item {return individual_inventory_item.equipped }}
if let InventoryItem::Individual(individual_inventory_item) = item {
if let ItemDetail::Weapon(_) = &individual_inventory_item.item {
return individual_inventory_item.equipped
}
}
false false
}) })
.nth(0)?; .nth(0)?;

Loading…
Cancel
Save