Core/Entities: don't allow client control if player is still affected by any lose of control state

Port From (https://github.com/TrinityCore/TrinityCore/commit/d0f4310c4417fb5dc8e89061adf4ce113caa4227)
This commit is contained in:
hondacrx
2021-06-23 14:39:59 -04:00
parent 84d05548f2
commit a34469c171
6 changed files with 117 additions and 124 deletions
+4 -5
View File
@@ -2698,15 +2698,15 @@ namespace Game.Spells
// This prevents spells such as Hunter's Mark from triggering pet attack
if (m_spellInfo.DmgClass != SpellDmgClass.None)
{
Unit unitTarget = m_targets.GetUnitTarget();
if (unitTarget)
Unit target = m_targets.GetUnitTarget();
if (target != null)
{
foreach (Unit controlled in playerCaster.m_Controlled)
{
Creature cControlled = controlled.ToCreature();
if (cControlled != null)
if (cControlled.IsAIEnabled)
cControlled.GetAI().OwnerAttacked(unitTarget);
cControlled.GetAI().OwnerAttacked(target);
}
}
}
@@ -2784,8 +2784,7 @@ namespace Game.Spells
if (aura_effmask != 0)
{
DiminishingGroup diminishGroup = m_spellInfo.GetDiminishingReturnsGroupForSpell();
if (diminishGroup != 0)
if (m_spellInfo.GetDiminishingReturnsGroupForSpell() != 0)
{
DiminishingReturnsType type = m_spellInfo.GetDiminishingReturnsGroupType();
if (type == DiminishingReturnsType.All || (type == DiminishingReturnsType.Player && target.IsAffectedByDiminishingReturns()))