mirror of
https://github.com/mangosfour/server.git
synced 2025-12-12 10:37:03 +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
|
|
@ -3470,7 +3470,7 @@ void Unit::_UpdateSpells( uint32 time )
|
|||
//(*i)->Update( difftime );
|
||||
if( !(*ite1)->isSpawned() )
|
||||
{
|
||||
(*ite1)->SetOwnerGUID(0);
|
||||
(*ite1)->SetOwnerGuid(ObjectGuid());
|
||||
(*ite1)->SetRespawnTime(0);
|
||||
(*ite1)->Delete();
|
||||
dnext1 = m_gameObj.erase(ite1);
|
||||
|
|
@ -4980,9 +4980,9 @@ GameObject* Unit::GetGameObject(uint32 spellId) const
|
|||
|
||||
void Unit::AddGameObject(GameObject* gameObj)
|
||||
{
|
||||
MANGOS_ASSERT(gameObj && gameObj->GetOwnerGUID()==0);
|
||||
MANGOS_ASSERT(gameObj && gameObj->GetOwnerGuid().IsEmpty());
|
||||
m_gameObj.push_back(gameObj);
|
||||
gameObj->SetOwnerGUID(GetGUID());
|
||||
gameObj->SetOwnerGuid(GetObjectGuid());
|
||||
|
||||
if ( GetTypeId()==TYPEID_PLAYER && gameObj->GetSpellId() )
|
||||
{
|
||||
|
|
@ -4996,9 +4996,9 @@ void Unit::AddGameObject(GameObject* gameObj)
|
|||
|
||||
void Unit::RemoveGameObject(GameObject* gameObj, bool del)
|
||||
{
|
||||
MANGOS_ASSERT(gameObj && gameObj->GetOwnerGUID()==GetGUID());
|
||||
MANGOS_ASSERT(gameObj && gameObj->GetOwnerGuid() == GetObjectGuid());
|
||||
|
||||
gameObj->SetOwnerGUID(0);
|
||||
gameObj->SetOwnerGuid(ObjectGuid());
|
||||
|
||||
// GO created by some spell
|
||||
if (uint32 spellid = gameObj->GetSpellId())
|
||||
|
|
@ -5034,7 +5034,7 @@ void Unit::RemoveGameObject(uint32 spellid, bool del)
|
|||
next = i;
|
||||
if(spellid == 0 || (*i)->GetSpellId() == spellid)
|
||||
{
|
||||
(*i)->SetOwnerGUID(0);
|
||||
(*i)->SetOwnerGuid(ObjectGuid());
|
||||
if(del)
|
||||
{
|
||||
(*i)->SetRespawnTime(0);
|
||||
|
|
@ -5053,7 +5053,7 @@ void Unit::RemoveAllGameObjects()
|
|||
// remove references to unit
|
||||
for(GameObjectList::iterator i = m_gameObj.begin(); i != m_gameObj.end();)
|
||||
{
|
||||
(*i)->SetOwnerGUID(0);
|
||||
(*i)->SetOwnerGuid(ObjectGuid());
|
||||
(*i)->SetRespawnTime(0);
|
||||
(*i)->Delete();
|
||||
i = m_gameObj.erase(i);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue