diff options
| author | Shauren <none@none> | 2010-06-11 20:02:46 +0200 |
|---|---|---|
| committer | Shauren <none@none> | 2010-06-11 20:02:46 +0200 |
| commit | 4261828d6301c4404a107351bba196a3cab033db (patch) | |
| tree | 02f7d1e6d10736cae068b40fdf42010dae3bad02 /src/server/game/Server | |
| parent | 96ac28ebadd43095d343303a43a79370a16deca1 (diff) | |
Added support for item set names in case where item does not exist in item_template (like gladiator gear)
--HG--
branch : trunk
Diffstat (limited to 'src/server/game/Server')
| -rw-r--r-- | src/server/game/Server/Protocol/Handlers/ItemHandler.cpp | 37 |
1 files changed, 11 insertions, 26 deletions
diff --git a/src/server/game/Server/Protocol/Handlers/ItemHandler.cpp b/src/server/game/Server/Protocol/Handlers/ItemHandler.cpp index 897ee7dcfd3..e9b9004804a 100644 --- a/src/server/game/Server/Protocol/Handlers/ItemHandler.cpp +++ b/src/server/game/Server/Protocol/Handlers/ItemHandler.cpp @@ -1003,40 +1003,25 @@ void WorldSession::HandleItemNameQueryOpcode(WorldPacket & recv_data) recv_data.read_skip<uint64>(); // guid sLog.outDebug("WORLD: CMSG_ITEM_NAME_QUERY %u", itemid); - ItemPrototype const *pProto = objmgr.GetItemPrototype(itemid); - if (pProto) + ItemSetNameEntry const *pName = objmgr.GetItemSetNameEntry(itemid); + if (pName) { - std::string Name; - Name = pProto->Name1; - + std::string Name = pName->name; int loc_idx = GetSessionDbLocaleIndex(); if (loc_idx >= 0) { - ItemLocale const *il = objmgr.GetItemLocale(pProto->ItemId); - if (il) - { - if (il->Name.size() > size_t(loc_idx) && !il->Name[loc_idx].empty()) - Name = il->Name[loc_idx]; - } + ItemSetNameLocale const *isnl = objmgr.GetItemSetNameLocale(itemid); + if (isnl) + if (isnl->Name.size() > size_t(loc_idx) && !isnl->Name[loc_idx].empty()) + Name = isnl->Name[loc_idx]; } - // guess size - WorldPacket data(SMSG_ITEM_NAME_QUERY_RESPONSE, (4+10)); - data << uint32(pProto->ItemId); + + WorldPacket data(SMSG_ITEM_NAME_QUERY_RESPONSE, (4+Name.size()+1+4)); + data << uint32(itemid); data << Name; - data << uint32(pProto->InventoryType); + data << uint32(pName->InventoryType); SendPacket(&data); - return; } -// This is a BS check, there are lots of items listed in Item.dbc that do not even exist on official -- so we can NEVER get the data for them. -// If you *really* want to spam your error log -- uncomment this. -/* else - { - // listed in dbc or not expected to exist unknown item - if (sItemStore.LookupEntry(itemid)) - sLog.outErrorDb("WORLD: CMSG_ITEM_NAME_QUERY for item %u failed (item listed in Item.dbc but not exist in DB)", itemid); - else - sLog.outError("WORLD: CMSG_ITEM_NAME_QUERY for item %u failed (unknown item, not listed in Item.dbc)", itemid); - } */ } void WorldSession::HandleWrapItemOpcode(WorldPacket& recv_data) |
