feat(Core/Debug): GetDebugInfo implementation (#12705)

Cherry-pick: 9a924fb9d5

Co-authored-by: jackpoz <giacomopoz@gmail.com>

Co-authored-by: jackpoz <giacomopoz@gmail.com>
This commit is contained in:
Maelthyr
2022-08-15 14:43:41 +02:00
committed by GitHub
parent 0fa783793e
commit d0d1671745
30 changed files with 218 additions and 20 deletions

View File

@@ -1097,7 +1097,7 @@ Item* Item::CreateItem(uint32 item, uint32 count, Player const* player, bool clo
if (count > pProto->GetMaxStackSize())
count = pProto->GetMaxStackSize();
ASSERT(count != 0 && "pProto->Stackable == 0 but checked at loading already");
ASSERT_NODEBUGINFO(count != 0 && "pProto->Stackable == 0 but checked at loading already");
Item* pItem = NewItemOrBag(pProto);
if (pItem->Create(sObjectMgr->GetGenerator<HighGuid::Item>().Generate(), item, player))
@@ -1287,3 +1287,13 @@ bool Item::CheckSoulboundTradeExpire()
return false;
}
std::string Item::GetDebugInfo() const
{
std::stringstream sstr;
sstr << Object::GetDebugInfo() << "\n"
<< std::boolalpha
<< "Owner: " << GetOwnerGUID().ToString() << " Count: " << GetCount()
<< " BagSlot: " << std::to_string(GetBagSlot()) << " Slot: " << std::to_string(GetSlot()) << " Equipped: " << IsEquipped();
return sstr.str();
}