Core/Entities: Use ObjectGuid class in game project
This commit is contained in:
1 parent
ce67a097bf
commit
a0e50ea35f
256 files changed
+3334
-3833
No files matched your search
@@ -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();
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user