Core/Objects: Fixed linked respawn cases when linking to itself in order to prevent respawning

This commit is contained in:
Shauren
2011-05-16 15:36:02 +02:00
parent 9650ba678b
commit a28da3582e
2 changed files with 3 additions and 3 deletions

View File

@@ -459,8 +459,8 @@ void Creature::Update(uint32 diff)
Respawn();
else // the master is dead
{
uint64 targetGuid = sObjectMgr->GetLinkedRespawnGuid(GetGUID());
if (targetGuid == GetGUID()) // if linking self, never respawn (check delayed to next day)
uint64 targetGuid = sObjectMgr->GetLinkedRespawnGuid(dbtableHighGuid);
if (targetGuid == dbtableHighGuid) // if linking self, never respawn (check delayed to next day)
SetRespawnTime(DAY);
else
m_respawnTime = (now > linkedRespawntime ? now : linkedRespawntime)+urand(5, MINUTE); // else copy time from master and add a little

View File

@@ -332,7 +332,7 @@ void GameObject::Update(uint32 diff)
if (linkedRespawntime) // Can't respawn, the master is dead
{
uint64 targetGuid = sObjectMgr->GetLinkedRespawnGuid(dbtableHighGuid);
if (targetGuid == GetGUID()) // if linking self, never respawn (check delayed to next day)
if (targetGuid == dbtableHighGuid) // if linking self, never respawn (check delayed to next day)
SetRespawnTime(DAY);
else
m_respawnTime = (now > linkedRespawntime ? now : linkedRespawntime)+urand(5, MINUTE); // else copy time from master and add a little