From 8fae8d11af9b56bc349c67fbf04145c0a5ae2243 Mon Sep 17 00:00:00 2001 From: jake Date: Mon, 9 Nov 2020 16:47:35 -0700 Subject: [PATCH] fix equipping bought weapon --- src/ship/packet/handler/message.rs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/ship/packet/handler/message.rs b/src/ship/packet/handler/message.rs index 0bfc4ac..79ceaa5 100644 --- a/src/ship/packet/handler/message.rs +++ b/src/ship/packet/handler/message.rs @@ -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())) }