mirror of
https://github.com/mod-playerbots/azerothcore-wotlk.git
synced 2026-02-07 04:47:45 +00:00
fix(Core/Creatures): Implemented `SUMMON_PROP_FLAG_ONLY_VISIBLE_TO_SU… (#14054)
* fix(Core/Creatures): Implemented `SUMMON_PROP_FLAG_ONLY_VISIBLE_TO_SUMMONER` summon flag. Fixes #6674 * Update.
This commit is contained in:
@@ -454,11 +454,27 @@ void ThreatMgr::AddThreat(Unit* victim, float threat, SpellSchoolMask schoolMask
|
||||
void ThreatMgr::DoAddThreat(Unit* victim, float threat)
|
||||
{
|
||||
uint32 redirectThreadPct = victim->GetRedirectThreatPercent();
|
||||
Unit* redirectTarget = victim->GetRedirectThreatTarget();
|
||||
|
||||
// Personal Spawns from same summoner can aggro each other
|
||||
if (TempSummon* tempSummonVictim = victim->ToTempSummon())
|
||||
{
|
||||
if (tempSummonVictim->IsVisibleBySummonerOnly())
|
||||
{
|
||||
if (!GetOwner()->ToTempSummon() ||
|
||||
!GetOwner()->ToTempSummon()->IsVisibleBySummonerOnly() ||
|
||||
tempSummonVictim->GetSummonerGUID() != GetOwner()->ToTempSummon()->GetSummonerGUID())
|
||||
{
|
||||
redirectThreadPct = 100;
|
||||
redirectTarget = tempSummonVictim->GetSummonerUnit();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// must check > 0.0f, otherwise dead loop
|
||||
if (threat > 0.0f && redirectThreadPct)
|
||||
{
|
||||
if (Unit* redirectTarget = victim->GetRedirectThreatTarget())
|
||||
if (redirectTarget)
|
||||
{
|
||||
float redirectThreat = CalculatePct(threat, redirectThreadPct);
|
||||
threat -= redirectThreat;
|
||||
|
||||
Reference in New Issue
Block a user