[11490] Alow implicit cast ObjectGuid->uint64 and only explicit uint64->ObjectGuid

Now safe allow this casts in like way after completed convertion to ObjectGuid use.
Also simplify code in result allowed auto cast to uint64.

Please _not_ add new uint64 storages (local and in structures) for guid values.
This commit is contained in:
VladimirMangos 2011-05-15 22:01:16 +04:00
parent ecdb435b1e
commit 249fb836ca
47 changed files with 194 additions and 210 deletions

View file

@ -102,7 +102,7 @@ bool ChatHandler::HandleNpcWhisperCommand(char* args)
return false;
ObjectGuid guid = m_session->GetPlayer()->GetSelectionGuid();
if (guid.IsEmpty())
if (!guid)
return false;
Creature* pCreature = m_session->GetPlayer()->GetMap()->GetCreature(guid);
@ -252,8 +252,7 @@ bool ChatHandler::HandleGPSCommand(char* args)
WorldObject *obj = NULL;
if (*args)
{
ObjectGuid guid = ExtractGuidFromLink(&args);
if (!guid.IsEmpty())
if (ObjectGuid guid = ExtractGuidFromLink(&args))
obj = (WorldObject*)m_session->GetPlayer()->GetObjectByTypeMask(guid, TYPEMASK_CREATURE_OR_GAMEOBJECT);
if(!obj)