mirror of
https://github.com/mangosfour/server.git
synced 2025-12-16 04:37:00 +00:00
Avoid access to bag item prototype for getting bag size, use related item update field instead as more fast source.
This commit is contained in:
parent
3162a8dc61
commit
6f6ec21b72
5 changed files with 112 additions and 202 deletions
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue