fix equipping bought weapon

This commit is contained in:
jake 2020-11-09 16:47:35 -07:00
parent 6e2fab31f0
commit 8fae8d11af

View File

@ -316,7 +316,12 @@ where
EG: EntityGateway
{
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?;
Ok(Box::new(None.into_iter()))
}