Browse Source

stray spaces

pull/80/head
jake 3 years ago
parent
commit
98260308e8
  1. 2
      src/ship/items/manager.rs
  2. 5
      src/ship/packet/handler/trade.rs

2
src/ship/items/manager.rs

@ -539,7 +539,7 @@ impl ItemManager {
let inventory = self.character_inventory.get_mut(&character.id).ok_or(ItemManagerError::NoCharacter(character.id))?;
let used_item = inventory.get_item_handle_by_id(item_id).ok_or(ItemManagerError::NoSuchItemId(item_id))?;
let consumed_item = used_item.consume(amount)?;
if let ItemDetail::TechniqueDisk(tech_disk) = consumed_item.item() {
// TODO: validate tech level in packet is in bounds [1..30]
character.techs.set_tech(tech_disk.tech, TechLevel(tech_disk.level as u8));

5
src/ship/packet/handler/trade.rs

@ -47,8 +47,7 @@ where
})
.next()
.ok_or(TradeError::CouldNotFindTradePartner)?;
let item_blobs = items_to_trade.items.iter().take(items_to_trade.count as usize);
let trade_items = item_blobs
.map(|item| {
@ -117,7 +116,7 @@ where
.map(|trade_partner| {
(trade_partner.client, SendShipPacket::CancelTrade(CancelTrade {}))
});
log::warn!("error in trading: {:?}", err);
Ok(Box::new(vec![(id, SendShipPacket::CancelTrade(CancelTrade {}))]
.into_iter()

Loading…
Cancel
Save