Browse Source

appease the clip

pull/47/head
andy 3 years ago
parent
commit
b60463eaa0
  1. 16
      src/ship/items/inventory.rs

16
src/ship/items/inventory.rs

@ -240,40 +240,40 @@ impl InventoryItem {
if a.is_rare_item() {
return Ok(10u32)
}
return Ok((ArmorShopItem::from(a).price() / 8) as u32)
Ok((ArmorShopItem::from(a).price() / 8) as u32)
},
ItemDetail::Shield(s) => {
if s.is_rare_item() {
return Ok(10u32)
}
return Ok((ArmorShopItem::from(s).price() / 8) as u32)
Ok((ArmorShopItem::from(s).price() / 8) as u32)
},
ItemDetail::Unit(u) => {
if u.is_rare_item() {
return Ok(10u32)
}
return Ok((ArmorShopItem::from(u).price() / 8) as u32)
Ok((ArmorShopItem::from(u).price() / 8) as u32)
},
ItemDetail::Tool(t) => {
if !matches!(t.tool, ToolType::PhotonDrop | ToolType::PhotonSphere | ToolType::PhotonCrystal) && t.is_rare_item() {
return Ok(10u32)
}
return Ok((ToolShopItem::from(t).price() / 8) as u32)
Ok((ToolShopItem::from(t).price() / 8) as u32)
},
ItemDetail::TechniqueDisk(d) => {
return Ok((ToolShopItem::from(d).price() / 8) as u32)
Ok((ToolShopItem::from(d).price() / 8) as u32)
},
ItemDetail::Mag(_m) => {
return Err(ItemManagerError::ItemNotSellable(self.clone()))
Err(ItemManagerError::ItemNotSellable(self.clone()))
},
ItemDetail::ESWeapon(_e) => {
return Ok(10u32)
Ok(10u32)
},
}
},
// the number of stacked items sold is handled by the caller. this is just the price of 1
InventoryItem::Stacked(stacked_item) => {
return Ok((ToolShopItem::from(&stacked_item.tool).price() / 8) as u32)
Ok((ToolShopItem::from(&stacked_item.tool).price() / 8) as u32)
},
}
}

Loading…
Cancel
Save