mirror of
https://github.com/mangosfour/server.git
synced 2025-12-13 04:37:00 +00:00
[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:
parent
ecdb435b1e
commit
249fb836ca
47 changed files with 194 additions and 210 deletions
|
|
@ -909,8 +909,7 @@ bool ChatHandler::HandleGameObjectDeleteCommand(char* args)
|
|||
return false;
|
||||
}
|
||||
|
||||
ObjectGuid ownerGuid = obj->GetOwnerGuid();
|
||||
if (!ownerGuid.IsEmpty())
|
||||
if (ObjectGuid ownerGuid = obj->GetOwnerGuid())
|
||||
{
|
||||
Unit* owner = ObjectAccessor::GetUnit(*m_session->GetPlayer(), ownerGuid);
|
||||
if (!owner || !ownerGuid.IsPlayer())
|
||||
|
|
@ -1213,7 +1212,7 @@ bool ChatHandler::HandleGUIDCommand(char* /*args*/)
|
|||
{
|
||||
ObjectGuid guid = m_session->GetPlayer()->GetSelectionGuid();
|
||||
|
||||
if (guid.IsEmpty())
|
||||
if (!guid)
|
||||
{
|
||||
SendSysMessage(LANG_NO_SELECTION);
|
||||
SetSentErrorMessage(true);
|
||||
|
|
@ -2207,7 +2206,7 @@ bool ChatHandler::HandleNpcTameCommand(char* /*args*/)
|
|||
|
||||
Player *player = m_session->GetPlayer ();
|
||||
|
||||
if (!player->GetPetGuid().IsEmpty())
|
||||
if (player->GetPetGuid())
|
||||
{
|
||||
SendSysMessage(LANG_YOU_ALREADY_HAVE_PET);
|
||||
SetSentErrorMessage(true);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue