From c831c69d9f50bf418295834ae83e9eb400dfc6b7 Mon Sep 17 00:00:00 2001 From: Fedja Beader Date: Sat, 27 Apr 2024 16:36:36 +0000 Subject: Fix "Show items" (equipment display on other players) See #73 for discussion Squashed with: * Fix mana pearl showing in arrows slot in Classic * Fix off-by-one. Was causing Old Towel to render in torso slot in ML. **** mana/plus!78 --- src/net/eathena/inventoryhandler.cpp | 2 +- src/net/tmwa/inventoryhandler.cpp | 3 +-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/src/net/eathena/inventoryhandler.cpp b/src/net/eathena/inventoryhandler.cpp index 3911c63fa..19197c851 100644 --- a/src/net/eathena/inventoryhandler.cpp +++ b/src/net/eathena/inventoryhandler.cpp @@ -572,7 +572,7 @@ void InventoryHandler::selectEgg(const Item *const item) const int InventoryHandler::convertFromServerSlot(const int serverSlot) const { - if (serverSlot < 0 || serverSlot >= 17) + if (serverSlot < 0 || serverSlot > 17) return 0; return CAST_S32(EQUIP_CONVERT[serverSlot]); diff --git a/src/net/tmwa/inventoryhandler.cpp b/src/net/tmwa/inventoryhandler.cpp index a438c2602..076d365f1 100644 --- a/src/net/tmwa/inventoryhandler.cpp +++ b/src/net/tmwa/inventoryhandler.cpp @@ -34,14 +34,13 @@ #include "debug.h" -// missing EQUIP_RING1_SLOT const EquipSlot::Type EQUIP_CONVERT[] = { EquipSlot::PROJECTILE_SLOT, // 0 0 EquipSlot::FEET_SLOT, // 1 SPRITE_HAIR EquipSlot::LEGS_SLOT, // 2 SPRITE_WEAPON EquipSlot::TORSO_SLOT, // 3 SPRITE_HEAD_BOTTOM - EquipSlot::PROJECTILE_SLOT, // 4 0 + EquipSlot::RING1_SLOT, // 4 SPRITE_HEAD_TOP EquipSlot::NECK_SLOT, // 5 SPRITE_RING EquipSlot::PROJECTILE_SLOT, // 6 0 EquipSlot::HEAD_SLOT, // 7 SPRITE_CLOTHES_COLOR -- cgit v1.2.3-60-g2f50