aboutsummaryrefslogtreecommitdiff
path: root/src/server/game/AI/CreatureAI.cpp
diff options
context:
space:
mode:
authortreeston <treeston.mmoc@gmail.com>2015-09-30 13:37:58 +0200
committertreeston <treeston.mmoc@gmail.com>2016-01-13 18:35:44 +0100
commitf481ae1048aac32ba3a40491f0304d0317234295 (patch)
treef3d4a3fc66879f921186115b99700bb864e6aef4 /src/server/game/AI/CreatureAI.cpp
parent1d9d03b2891b5481eff6541a8563599ccc60c48d (diff)
Core/Spells: Creature spellcast facing rework:
- Fixes creatures turning just before a spellcast finishes and smacking players with supposedly-unavoidable damage. Fixes and closes #15393, #10803, and probably others. - Fixes visual effects not lining up with the correct target for spells that have their visual aligned with the caster's orientation (examples: Anub'rekhan Impale, Ingvar's Smash/Dark Smash, etc.). Fixes and closes #2947 and probably a bunch of others, including the aforementioned #15393 and #10803. - Creatures' displayed target now properly matches the unit they are targeting with spells for a split second (blizzlike). This is necessary to get proper client-side orientation.
Diffstat (limited to 'src/server/game/AI/CreatureAI.cpp')
-rw-r--r--src/server/game/AI/CreatureAI.cpp9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/server/game/AI/CreatureAI.cpp b/src/server/game/AI/CreatureAI.cpp
index e94f5a037a3..f8744655184 100644
--- a/src/server/game/AI/CreatureAI.cpp
+++ b/src/server/game/AI/CreatureAI.cpp
@@ -203,7 +203,8 @@ void CreatureAI::SetGazeOn(Unit* target)
{
if (me->IsValidAttackTarget(target))
{
- AttackStart(target);
+ if (!me->IsFocusing(nullptr, true))
+ AttackStart(target);
me->SetReactState(REACT_PASSIVE);
}
}
@@ -222,7 +223,8 @@ bool CreatureAI::UpdateVictimWithGaze()
}
if (Unit* victim = me->SelectVictim())
- AttackStart(victim);
+ if (!me->IsFocusing(nullptr, true))
+ AttackStart(victim);
return me->GetVictim() != nullptr;
}
@@ -235,7 +237,8 @@ bool CreatureAI::UpdateVictim()
if (!me->HasReactState(REACT_PASSIVE))
{
if (Unit* victim = me->SelectVictim())
- AttackStart(victim);
+ if (!me->IsFocusing(nullptr, true))
+ AttackStart(victim);
return me->GetVictim() != nullptr;
}