Skip to content

Commit

Permalink
AI: Do not engage CreatureStaticFlags::NO_MELEE_FLEE flee if casting …
Browse files Browse the repository at this point in the history
…spell

Give a script the option to override it with an aggro hook
  • Loading branch information
killerwife committed Jan 1, 2025
1 parent 480f9b4 commit dc20d1f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/game/AI/BaseAI/CreatureAI.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ void CreatureAI::EnterCombat(Unit* enemy)
{
UnitAI::EnterCombat(enemy);
// TODO: Monitor this condition to see if it conflicts with any pets
if (m_creature->GetSettings().HasFlag(CreatureStaticFlags::NO_MELEE_FLEE) && !m_creature->IsRooted() && !m_creature->IsInPanic() && enemy && enemy->IsPlayerControlled())
if (m_creature->GetSettings().HasFlag(CreatureStaticFlags::NO_MELEE_FLEE) && !m_creature->IsRooted() && !m_creature->IsInPanic() && !m_creature->IsNonMeleeSpellCasted(false) && enemy && enemy->IsPlayerControlled())

This comment has been minimized.

Copy link
@insunaa

insunaa Jan 1, 2025

Contributor

in this if statement, what is the purpose if m_creature->IsRooted()?
shouldn't they "try" to flee anyway. As it is currently when you root or stun a critter as the first combat action, SetAIOrder(ORDER_CRITTER_FLEE) is not called, so when the root/stun breaks the critter enters combat normally.
I know this has nothing to do with this specific commit, just a general question.

{
DoFlee(30000);
SetAIOrder(ORDER_CRITTER_FLEE); // mark as critter flee for custom handling
Expand Down

0 comments on commit dc20d1f

Please sign in to comment.