Core/Entities: Use ObjectGuid class in game project

This commit is contained in:
Shauren
2014-09-14 16:14:12 +02:00
parent ce67a097bf
commit a0e50ea35f
256 changed files with 3334 additions and 3833 deletions
+8 -12
View File
@@ -20,6 +20,9 @@
#include "World.h"
#include "ObjectMgr.h"
#include <sstream>
#include <iomanip>
ObjectGuid const ObjectGuid::Empty = ObjectGuid();
char const* ObjectGuid::GetTypeName(HighGuid high)
{
@@ -45,19 +48,12 @@ char const* ObjectGuid::GetTypeName(HighGuid high)
std::string ObjectGuid::ToString() const
{
std::ostringstream str;
str << GetTypeName();
if (IsPlayer())
{
std::string name;
if (sObjectMgr->GetPlayerNameByGUID(m_guid, name))
str << " " << name;
}
str << " (";
str << "GUID Full: 0x" << std::hex << std::setw(16) << std::setfill('0') << m_guid;
str << " Type: " << GetTypeName();
if (HasEntry())
str << (IsPet() ? "Petnumber: " : "Entry: ") << GetEntry() << " ";
str << "Guid: " << GetCounter() << ")";
str << (IsPet() ? " Pet number: " : " Entry: ") << GetEntry() << " ";
str << " Low: " << GetCounter();
return str.str();
}