PSendSysMessage("item at slot %d, guid %d has an incorrect slot value: %d",i,item->GetGUIDLow(),item->GetSlot());
error=true;continue;
}
if(item->GetOwnerGUID()!=player->GetGUID())
{
PSendSysMessage("for the item at slot %d and itemguid %d, owner's guid (%d) and player's guid (%d) don't match!",item->GetSlot(),item->GetGUIDLow(),GUID_LOPART(item->GetOwnerGUID()),player->GetGUIDLow());
error=true;continue;
}
if(Bag*container=item->GetContainer())
{
PSendSysMessage("item at slot: %d guid: %d has a container (slot: %d, guid: %d) but shouldnt!",item->GetSlot(),item->GetGUIDLow(),container->GetSlot(),container->GetGUIDLow());
error=true;continue;
}
if(item->IsInUpdateQueue())
{
uint16qp=item->GetQueuePos();
if(qp>updateQueue.size())
{
PSendSysMessage("item at slot: %d guid: %d has a queuepos (%d) larger than the update queue size! ",item->GetSlot(),item->GetGUIDLow(),qp);
error=true;continue;
}
if(updateQueue[qp]==NULL)
{
PSendSysMessage("item at slot: %d guid: %d has a queuepos (%d) that points to NULL in the queue!",item->GetSlot(),item->GetGUIDLow(),qp);
error=true;continue;
}
if(updateQueue[qp]!=item)
{
PSendSysMessage("item at slot: %d guid: %d has has a queuepos (%d) that points to another item in the queue (bag: %d, slot: %d, guid: %d)",item->GetSlot(),item->GetGUIDLow(),qp,updateQueue[qp]->GetBagSlot(),updateQueue[qp]->GetSlot(),updateQueue[qp]->GetGUIDLow());
error=true;continue;
}
}
elseif(item->GetState()!=ITEM_UNCHANGED)
{
PSendSysMessage("item at slot: %d guid: %d is not in queue but should be (state: %d)!",item->GetSlot(),item->GetGUIDLow(),item->GetState());
error=true;continue;
}
if(item->IsBag())
{
Bag*bag=(Bag*)item;
for(uint8j=0;j<bag->GetBagSize();++j)
{
Item*item=bag->GetItemByPos(j);
if(!item)continue;
if(item->GetSlot()!=j)
{
PSendSysMessage("the item in bag %d slot %d, guid %d has an incorrect slot value: %d",bag->GetSlot(),j,item->GetGUIDLow(),item->GetSlot());
error=true;continue;
}
if(item->GetOwnerGUID()!=player->GetGUID())
{
PSendSysMessage("for the item in bag %d at slot %d and itemguid %d, owner's guid (%d) and player's guid (%d) don't match!",bag->GetSlot(),item->GetSlot(),item->GetGUIDLow(),GUID_LOPART(item->GetOwnerGUID()),player->GetGUIDLow());
error=true;continue;
}
Bag*container=item->GetContainer();
if(!container)
{
PSendSysMessage("the item in bag %d at slot %d with guid %d has no container!",bag->GetSlot(),item->GetSlot(),item->GetGUIDLow());
error=true;continue;
}
if(container!=bag)
{
PSendSysMessage("the item in bag %d at slot %d with guid %d has a different container(slot %d guid %d)!",bag->GetSlot(),item->GetSlot(),item->GetGUIDLow(),container->GetSlot(),container->GetGUIDLow());
error=true;continue;
}
if(item->IsInUpdateQueue())
{
uint16qp=item->GetQueuePos();
if(qp>updateQueue.size())
{
PSendSysMessage("item in bag: %d at slot: %d guid: %d has a queuepos (%d) larger than the update queue size! ",bag->GetSlot(),item->GetSlot(),item->GetGUIDLow(),qp);
error=true;continue;
}
if(updateQueue[qp]==NULL)
{
PSendSysMessage("item in bag: %d at slot: %d guid: %d has a queuepos (%d) that points to NULL in the queue!",bag->GetSlot(),item->GetSlot(),item->GetGUIDLow(),qp);
error=true;continue;
}
if(updateQueue[qp]!=item)
{
PSendSysMessage("item in bag: %d at slot: %d guid: %d has has a queuepos (%d) that points to another item in the queue (bag: %d, slot: %d, guid: %d)",bag->GetSlot(),item->GetSlot(),item->GetGUIDLow(),qp,updateQueue[qp]->GetBagSlot(),updateQueue[qp]->GetSlot(),updateQueue[qp]->GetGUIDLow());
error=true;continue;
}
}
elseif(item->GetState()!=ITEM_UNCHANGED)
{
PSendSysMessage("item in bag: %d at slot: %d guid: %d is not in queue but should be (state: %d)!",bag->GetSlot(),item->GetSlot(),item->GetGUIDLow(),item->GetState());
error=true;continue;
}
}
}
}
for(size_ti=0;i<updateQueue.size();i++)
{
Item*item=updateQueue[i];
if(!item)continue;
if(item->GetOwnerGUID()!=player->GetGUID())
{
PSendSysMessage("queue(%d): for the an item (guid %d), the owner's guid (%d) and player's guid (%d) don't match!",i,item->GetGUIDLow(),GUID_LOPART(item->GetOwnerGUID()),player->GetGUIDLow());
error=true;continue;
}
if(item->GetQueuePos()!=i)
{
PSendSysMessage("queue(%d): for the an item (guid %d), the queuepos doesn't match it's position in the queue!",i,item->GetGUIDLow());
PSendSysMessage("queue(%d): the bag(%d) and slot(%d) values for the item with guid %d are incorrect, the player doesn't have an item at that position!",i,item->GetBagSlot(),item->GetSlot(),item->GetGUIDLow());
error=true;continue;
}
if(test!=item)
{
PSendSysMessage("queue(%d): the bag(%d) and slot(%d) values for the item with guid %d are incorrect, the item with guid %d is there instead!",i,item->GetBagSlot(),item->GetSlot(),item->GetGUIDLow(),test->GetGUIDLow());