Browse Source

fix equipping bought weapon

pbs
jake 4 years ago
parent
commit
8fae8d11af
  1. 7
      src/ship/packet/handler/message.rs

7
src/ship/packet/handler/message.rs

@ -316,7 +316,12 @@ where
EG: EntityGateway EG: EntityGateway
{ {
let client = clients.get(&id).ok_or(ShipError::ClientNotFound(id))?; let client = clients.get(&id).ok_or(ShipError::ClientNotFound(id))?;
let equip_slot = ((pkt.sub_menu & 0x7) - 1) % 4;
let equip_slot = if pkt.sub_menu > 0 {
((pkt.sub_menu & 0x7) - 1) % 4
}
else {
0
};
item_manager.player_equips_item(entity_gateway, &client.character, ClientItemId(pkt.item_id), equip_slot).await?; item_manager.player_equips_item(entity_gateway, &client.character, ClientItemId(pkt.item_id), equip_slot).await?;
Ok(Box::new(None.into_iter())) Ok(Box::new(None.into_iter()))
} }

Loading…
Cancel
Save