diff options
author | megamage <none@none> | 2009-04-27 19:14:37 -0500 |
---|---|---|
committer | megamage <none@none> | 2009-04-27 19:14:37 -0500 |
commit | 2b753d0f23593849dc2b440406e6f7006c104c53 (patch) | |
tree | 2314d720fb6210e27e93ccb7a0eed83b5dae8b17 /src/game/CreatureEventAI.cpp | |
parent | d4c75dddea881d544524ac4373f097f15a603c18 (diff) |
[7723] New AI call EnterCombat called at enter creature to combat (and re-enter if leave by some reason). Author: VladimirMangos
--HG--
branch : trunk
Diffstat (limited to 'src/game/CreatureEventAI.cpp')
-rw-r--r-- | src/game/CreatureEventAI.cpp | 11 |
1 files changed, 3 insertions, 8 deletions
diff --git a/src/game/CreatureEventAI.cpp b/src/game/CreatureEventAI.cpp index a4d08b3dfed..b201aafe4dd 100644 --- a/src/game/CreatureEventAI.cpp +++ b/src/game/CreatureEventAI.cpp @@ -625,7 +625,7 @@ void CreatureEventAI::ProcessAction(uint16 type, uint32 param1, uint32 param2, u } //Allowed to cast only if not casting (unless we interrupt ourself) or if spell is triggered - bool canCast = !(caster->IsNonMeleeSpellCasted(false) && !(param3 & CAST_TRIGGERED | CAST_INTURRUPT_PREVIOUS)); + bool canCast = !caster->IsNonMeleeSpellCasted(false) || (param3 & (CAST_TRIGGERED | CAST_INTURRUPT_PREVIOUS)); // If cast flag CAST_AURA_NOT_PRESENT is active, check if target already has aura on them if(param3 & CAST_AURA_NOT_PRESENT) @@ -1143,7 +1143,7 @@ void CreatureEventAI::JustSummoned(Creature* pUnit) } } -void CreatureEventAI::Aggro(Unit *who) +void CreatureEventAI::EnterCombat(Unit *enemy) { //Check for on combat start events if (!bEmptyList) @@ -1154,7 +1154,7 @@ void CreatureEventAI::Aggro(Unit *who) { case EVENT_T_AGGRO: (*i).Enabled = true; - ProcessEvent(*i, who); + ProcessEvent(*i, enemy); break; //Reset all in combat timers case EVENT_T_TIMER: @@ -1189,13 +1189,8 @@ void CreatureEventAI::AttackStart(Unit *who) if (!who) return; - bool inCombat = m_creature->isInCombat(); - if (m_creature->Attack(who, MeleeEnabled)) { - if (!inCombat) - Aggro(who); - if (CombatMovementEnabled) { m_creature->GetMotionMaster()->MoveChase(who, AttackDistance, AttackAngle); |