Core/Objects: Move personal summon handling from TemporarySummon/GameObject to WorldObject and check it using dedicated guid field
Port From (https://github.com/TrinityCore/TrinityCore/commit/1082a6645e96c611b3145b5d6208fc4db6e4b2d3)
This commit is contained in:
@@ -88,20 +88,10 @@ namespace Game.Combat
|
||||
Unit redirectTarget = victim.GetRedirectThreatTarget();
|
||||
|
||||
// If victim is personnal spawn, redirect all aggro to summoner
|
||||
TempSummon tempSummonVictim = victim.ToTempSummon();
|
||||
if (tempSummonVictim)
|
||||
if (victim.IsPrivateObject() && GetOwner().IsPrivateObject() && GetOwner().CanSeeOrDetect(victim))
|
||||
{
|
||||
if (tempSummonVictim.IsVisibleBySummonerOnly())
|
||||
{
|
||||
// Personnal Spawns from same summoner can aggro each other
|
||||
if (!GetOwner().ToTempSummon() ||
|
||||
!GetOwner().ToTempSummon().IsVisibleBySummonerOnly() ||
|
||||
tempSummonVictim.GetSummonerGUID() != GetOwner().ToTempSummon().GetSummonerGUID())
|
||||
{
|
||||
redirectThreadPct = 100;
|
||||
redirectTarget = tempSummonVictim.GetSummoner();
|
||||
}
|
||||
}
|
||||
redirectThreadPct = 100;
|
||||
redirectTarget = Global.ObjAccessor.GetUnit(GetOwner(), victim.GetPrivateObjectOwner());
|
||||
}
|
||||
|
||||
// must check > 0.0f, otherwise dead loop
|
||||
|
||||
Reference in New Issue
Block a user