From 6af0fd168ca12a4060ace5bccfbff88a7e3126db Mon Sep 17 00:00:00 2001 From: Guillaume Dupuy Date: Thu, 16 Mar 2017 13:36:56 +0100 Subject: [PATCH] Use SLOT_EQUIPEMENT instead of SLOTTYPE --HG-- branch : item_group --- code/ryzom/client/src/item_group_manager.cpp | 11 +++++------ code/ryzom/client/src/item_group_manager.h | 4 ++-- 2 files changed, 7 insertions(+), 8 deletions(-) diff --git a/code/ryzom/client/src/item_group_manager.cpp b/code/ryzom/client/src/item_group_manager.cpp index b987420c8..e69cbdfd4 100644 --- a/code/ryzom/client/src/item_group_manager.cpp +++ b/code/ryzom/client/src/item_group_manager.cpp @@ -118,8 +118,8 @@ void CItemGroup::readFrom(xmlNodePtr node) ptrName = (char*) xmlGetProp(curNode, (xmlChar*)"slot"); if (ptrName) NLMISC::fromString((const char*)ptrName, slot); slot = NLMISC::toUpper(slot); - if(SLOTTYPE::stringToSlotType(slot) != SLOTTYPE::UNDEFINED) - removeBeforeEquip.push_back(SLOTTYPE::stringToSlotType(slot)); + if(SLOT_EQUIPMENT::stringToSlotEquipment(slot) != SLOT_EQUIPMENT::UNDEFINED) + removeBeforeEquip.push_back(SLOT_EQUIPMENT::stringToSlotEquipment(slot)); } curNode = curNode->next; @@ -338,14 +338,13 @@ bool CItemGroupManager::equipGroup(std::string name, bool pullBefore) //Start by unequipping all slot that user wants to unequip for(int i=0; i < group->removeBeforeEquip.size(); i++) { - SLOTTYPE::TSlotType slot = group->removeBeforeEquip[i]; + SLOT_EQUIPMENT::TSlotEquipment slot = group->removeBeforeEquip[i]; std::string dbPath; - if(slot > SLOTTYPE::RIGHT_HAND) + if(slot == SLOT_EQUIPMENT::HANDL || slot == SLOT_EQUIPMENT::HANDR) dbPath = "LOCAL:INVENTORY:HAND:"; else dbPath = "LOCAL:INVENTORY:EQUIP:"; - //offset by 1 : TSlotType begins at 1 for actual items (because of UNDEFINED), whereas dbPath start at 0 - dbPath += NLMISC::toString((uint8)slot - 1); + dbPath += NLMISC::toString((uint8)slot); CInventoryManager::getInstance()->unequip(dbPath); } diff --git a/code/ryzom/client/src/item_group_manager.h b/code/ryzom/client/src/item_group_manager.h index c9278d1f2..533071cc4 100644 --- a/code/ryzom/client/src/item_group_manager.h +++ b/code/ryzom/client/src/item_group_manager.h @@ -21,7 +21,7 @@ #include "interface_v3/inventory_manager.h" #include "interface_v3/dbctrl_sheet.h" #include "game_share/inventories.h" -#include "game_share/slot_types.h" +#include "game_share/slot_equipment.h" struct CInventoryItem { public: @@ -62,7 +62,7 @@ public: std::string name; std::vector Items; - std::vector removeBeforeEquip; + std::vector removeBeforeEquip; }; class CItemGroupManager {