diff options
| author | Matan Shukry <matanshukry@gmail.com> | 2021-03-14 21:23:07 +0200 |
|---|---|---|
| committer | Shauren <shauren.trinity@gmail.com> | 2024-10-05 16:54:13 +0200 |
| commit | 262a1e5b36dfea97f2dfc4b838dd3d59c6ed2fb3 (patch) | |
| tree | bf4ba2fbf46a031346c6a50d25f40dba197190b6 /src/server/game/Combat | |
| parent | 4d083b074ff7307d8f492d6f55f315425f299720 (diff) | |
Core/Objects: Move personal summon handling from TemporarySummon/GameObject to WorldObject and check it using dedicated guid field
(cherry picked from commit 1082a6645e96c611b3145b5d6208fc4db6e4b2d3)
Diffstat (limited to 'src/server/game/Combat')
| -rw-r--r-- | src/server/game/Combat/ThreatManager.cpp | 19 |
1 files changed, 6 insertions, 13 deletions
diff --git a/src/server/game/Combat/ThreatManager.cpp b/src/server/game/Combat/ThreatManager.cpp index 50ad9a8e673..8263fcc3365 100644 --- a/src/server/game/Combat/ThreatManager.cpp +++ b/src/server/game/Combat/ThreatManager.cpp @@ -374,21 +374,14 @@ void ThreatManager::AddThreat(Unit* target, float amount, SpellInfo const* spell return; amount = 0.0f; } - else if (TempSummon* tempSummonVictim = target->ToTempSummon()) + + // If victim is personal spawn, redirect all aggro to summoner + if (target->IsPrivateObject() && GetOwner()->IsPrivateObject() && GetOwner()->CanSeeOrDetect(target)) { - if (tempSummonVictim->IsVisibleBySummonerOnly()) + if (Unit* privateObjectOwner = ObjectAccessor::GetUnit(*GetOwner(), target->GetPrivateObjectOwner())) { - if (Unit* tempSummonSummoner = tempSummonVictim->GetSummonerUnit()) - { - // Personnal Spawns from same summoner can aggro each other - if (!_owner->ToTempSummon() || - !_owner->ToTempSummon()->IsVisibleBySummonerOnly() || - tempSummonVictim->GetSummonerGUID() != GetOwner()->ToTempSummon()->GetSummonerGUID()) - { - AddThreat(tempSummonSummoner, amount, spell, ignoreModifiers, ignoreRedirects); - amount = 0.0f; - } - } + AddThreat(privateObjectOwner, amount, spell, ignoreModifiers, ignoreRedirects); + amount = 0.0f; } } |
