mirror of
https://github.com/mangosfour/server.git
synced 2025-12-16 04:37:00 +00:00
[10749] Convert Gameobject owner to objectguid use.
This commit is contained in:
parent
f5cf98e9f4
commit
6154cb3b43
13 changed files with 40 additions and 32 deletions
|
|
@ -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;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue