[10749] Convert Gameobject owner to objectguid use.

This commit is contained in:
VladimirMangos 2010-11-19 20:53:04 +03:00
parent f5cf98e9f4
commit 6154cb3b43
13 changed files with 40 additions and 32 deletions

View file

@ -906,13 +906,13 @@ bool ChatHandler::HandleGameObjectDeleteCommand(char* args)
return false;
}
uint64 owner_guid = obj->GetOwnerGUID();
if (owner_guid)
ObjectGuid ownerGuid = obj->GetOwnerGuid();
if (!ownerGuid.IsEmpty())
{
Unit* owner = ObjectAccessor::GetUnit(*m_session->GetPlayer(),owner_guid);
if (!owner || !IS_PLAYER_GUID(owner_guid))
Unit* owner = ObjectAccessor::GetUnit(*m_session->GetPlayer(), ownerGuid);
if (!owner || !ownerGuid.IsPlayer())
{
PSendSysMessage(LANG_COMMAND_DELOBJREFERCREATURE, GUID_LOPART(owner_guid), obj->GetGUIDLow());
PSendSysMessage(LANG_COMMAND_DELOBJREFERCREATURE, obj->GetGUIDLow(), ownerGuid.GetString().c_str());
SetSentErrorMessage(true);
return false;
}