aboutsummaryrefslogtreecommitdiff
path: root/src/game/debugcmds.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/game/debugcmds.cpp')
-rw-r--r--src/game/debugcmds.cpp6
1 files changed, 2 insertions, 4 deletions
diff --git a/src/game/debugcmds.cpp b/src/game/debugcmds.cpp
index e8deb551ebf..e98550315f9 100644
--- a/src/game/debugcmds.cpp
+++ b/src/game/debugcmds.cpp
@@ -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;