mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-19 08:55:32 +01:00
Core/Objects: Fixed linked respawn cases when linking to itself in order to prevent respawning
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user