mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-20 17:27:36 +01:00
[svn] * Avoid access to bag item prototype for getting bag size, use related item
update field instead as more fast source. source mangos. * Further reduce of DB access in guild handlers. * Multi-locale DBC extracting - source Foks *** Devs not responsible if all your player items drop to the ground and get eaten by ants or rabbits.. or some kind of wierd ant-rabbits.. --HG-- branch : trunk
This commit is contained in:
@@ -319,8 +319,7 @@ bool ChatHandler::HandleGetItemState(const char* args)
|
||||
else
|
||||
{
|
||||
Bag *bag = (Bag*)item;
|
||||
const ItemPrototype *proto = bag->GetProto();
|
||||
for (uint8 j = 0; j < proto->ContainerSlots; ++j)
|
||||
for (uint8 j = 0; j < bag->GetBagSize(); ++j)
|
||||
{
|
||||
Item* item = bag->GetItemByPos(j);
|
||||
if (item && item->GetState() == state)
|
||||
@@ -416,8 +415,7 @@ bool ChatHandler::HandleGetItemState(const char* args)
|
||||
if(item->IsBag())
|
||||
{
|
||||
Bag *bag = (Bag*)item;
|
||||
const ItemPrototype *proto = bag->GetProto();
|
||||
for (uint8 j = 0; j < proto->ContainerSlots; ++j)
|
||||
for (uint8 j = 0; j < bag->GetBagSize(); ++j)
|
||||
{
|
||||
Item* item = bag->GetItemByPos(j);
|
||||
if (!item) continue;
|
||||
|
||||
Reference in New Issue
Block a user