mirror of
https://github.com/mangosfour/server.git
synced 2025-12-17 16:37:00 +00:00
[7668] Cleanup In CreatureAI function descriptions and AttackStart/AttackedBy use.
* Use AI::AttackStart calls only in case explicit request creature attack from core or AI code "attack it if can". Like taunt, pet handler attack command. * Use AI::AttackedBy for reaction at hostile action "do something at hostile action" Like non-dot damage, swing, negative spell landing, or fade fear/etc. And provided by default call AttackStart if no current target. This fix some problems, like: * Civilian will react propertly at attack by another creature (not pet or player). * Will not cases (at least triggred by core) when attack target start run to attacker before any real hostile action apply.
This commit is contained in:
parent
69fb9736cc
commit
d85e95295d
11 changed files with 72 additions and 82 deletions
|
|
@ -3116,7 +3116,7 @@ void Aura::HandleModPossess(bool apply, bool Real)
|
|||
((Creature*)m_target)->AIM_Initialize();
|
||||
|
||||
if (((Creature*)m_target)->AI())
|
||||
((Creature*)m_target)->AI()->AttackStart(caster);
|
||||
((Creature*)m_target)->AI()->AttackedBy(caster);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -3269,7 +3269,7 @@ void Aura::HandleModCharm(bool apply, bool Real)
|
|||
{
|
||||
((Creature*)m_target)->AIM_Initialize();
|
||||
if (((Creature*)m_target)->AI())
|
||||
((Creature*)m_target)->AI()->AttackStart(caster);
|
||||
((Creature*)m_target)->AI()->AttackedBy(caster);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue