aboutsummaryrefslogtreecommitdiff
path: root/src/server/game/AI
diff options
context:
space:
mode:
authorShocker <shocker@freakz.ro>2012-02-03 19:02:17 +0200
committerShocker <shocker@freakz.ro>2012-02-03 19:02:17 +0200
commit08be716ef8a53a239ca4b2dc1df37dc9c65e8892 (patch)
tree479616d7f08bb2998b242439979600b793a310c5 /src/server/game/AI
parente602619912654ef0b97f02fa97aa7dbb537c2f89 (diff)
Core/Misc: Rename UNIT_STAT_* enums to UNIT_STATE_*
Diffstat (limited to 'src/server/game/AI')
-rwxr-xr-xsrc/server/game/AI/CoreAI/CombatAI.cpp4
-rwxr-xr-xsrc/server/game/AI/CoreAI/PassiveAI.cpp8
-rwxr-xr-xsrc/server/game/AI/CoreAI/PetAI.cpp4
-rwxr-xr-xsrc/server/game/AI/CoreAI/UnitAI.cpp4
-rwxr-xr-xsrc/server/game/AI/CreatureAIImpl.h4
-rwxr-xr-xsrc/server/game/AI/EventAI/CreatureEventAI.cpp4
-rw-r--r--src/server/game/AI/ScriptedAI/ScriptedCreature.cpp4
-rw-r--r--src/server/game/AI/ScriptedAI/ScriptedEscortAI.cpp2
-rw-r--r--src/server/game/AI/ScriptedAI/ScriptedFollowerAI.cpp14
-rw-r--r--src/server/game/AI/SmartScripts/SmartScript.cpp2
10 files changed, 25 insertions, 25 deletions
diff --git a/src/server/game/AI/CoreAI/CombatAI.cpp b/src/server/game/AI/CoreAI/CombatAI.cpp
index a83fb6f2789..e178efc7eee 100755
--- a/src/server/game/AI/CoreAI/CombatAI.cpp
+++ b/src/server/game/AI/CoreAI/CombatAI.cpp
@@ -99,7 +99,7 @@ void CombatAI::UpdateAI(const uint32 diff)
events.Update(diff);
- if (me->HasUnitState(UNIT_STAT_CASTING))
+ if (me->HasUnitState(UNIT_STATE_CASTING))
return;
if (uint32 spellId = events.ExecuteEvent())
@@ -158,7 +158,7 @@ void CasterAI::UpdateAI(const uint32 diff)
events.Update(diff);
- if (me->HasUnitState(UNIT_STAT_CASTING))
+ if (me->HasUnitState(UNIT_STATE_CASTING))
return;
if (uint32 spellId = events.ExecuteEvent())
diff --git a/src/server/game/AI/CoreAI/PassiveAI.cpp b/src/server/game/AI/CoreAI/PassiveAI.cpp
index 1244e032dbd..3738d5bab6c 100755
--- a/src/server/game/AI/CoreAI/PassiveAI.cpp
+++ b/src/server/game/AI/CoreAI/PassiveAI.cpp
@@ -61,14 +61,14 @@ void PossessedAI::KilledUnit(Unit* victim)
void CritterAI::DamageTaken(Unit* /*done_by*/, uint32&)
{
- if (!me->HasUnitState(UNIT_STAT_FLEEING))
- me->SetControlled(true, UNIT_STAT_FLEEING);
+ if (!me->HasUnitState(UNIT_STATE_FLEEING))
+ me->SetControlled(true, UNIT_STATE_FLEEING);
}
void CritterAI::EnterEvadeMode()
{
- if (me->HasUnitState(UNIT_STAT_FLEEING))
- me->SetControlled(false, UNIT_STAT_FLEEING);
+ if (me->HasUnitState(UNIT_STATE_FLEEING))
+ me->SetControlled(false, UNIT_STATE_FLEEING);
CreatureAI::EnterEvadeMode();
}
diff --git a/src/server/game/AI/CoreAI/PetAI.cpp b/src/server/game/AI/CoreAI/PetAI.cpp
index 015e20415b1..83a89a966c5 100755
--- a/src/server/game/AI/CoreAI/PetAI.cpp
+++ b/src/server/game/AI/CoreAI/PetAI.cpp
@@ -116,14 +116,14 @@ void PetAI::UpdateAI(const uint32 diff)
else
HandleReturnMovement();
}
- else if (owner && !me->HasUnitState(UNIT_STAT_FOLLOW)) // no charm info and no victim
+ else if (owner && !me->HasUnitState(UNIT_STATE_FOLLOW)) // no charm info and no victim
me->GetMotionMaster()->MoveFollow(owner, PET_FOLLOW_DIST, me->GetFollowAngle());
if (!me->GetCharmInfo())
return;
// Autocast (casted only in combat or persistent spells in any state)
- if (!me->HasUnitState(UNIT_STAT_CASTING))
+ if (!me->HasUnitState(UNIT_STATE_CASTING))
{
typedef std::vector<std::pair<Unit*, Spell*> > TargetSpellList;
TargetSpellList targetSpellStore;
diff --git a/src/server/game/AI/CoreAI/UnitAI.cpp b/src/server/game/AI/CoreAI/UnitAI.cpp
index 38504b90b19..bf50909eeee 100755
--- a/src/server/game/AI/CoreAI/UnitAI.cpp
+++ b/src/server/game/AI/CoreAI/UnitAI.cpp
@@ -40,7 +40,7 @@ void UnitAI::AttackStartCaster(Unit* victim, float dist)
void UnitAI::DoMeleeAttackIfReady()
{
- if (me->HasUnitState(UNIT_STAT_CASTING))
+ if (me->HasUnitState(UNIT_STATE_CASTING))
return;
Unit* victim = me->getVictim();
@@ -60,7 +60,7 @@ void UnitAI::DoMeleeAttackIfReady()
bool UnitAI::DoSpellAttackIfReady(uint32 spell)
{
- if (me->HasUnitState(UNIT_STAT_CASTING))
+ if (me->HasUnitState(UNIT_STATE_CASTING))
return true;
if (me->isAttackReady())
diff --git a/src/server/game/AI/CreatureAIImpl.h b/src/server/game/AI/CreatureAIImpl.h
index 147e829b0df..f568da80b49 100755
--- a/src/server/game/AI/CreatureAIImpl.h
+++ b/src/server/game/AI/CreatureAIImpl.h
@@ -596,7 +596,7 @@ inline bool CreatureAI::_EnterEvadeMode()
inline void UnitAI::DoCast(Unit* victim, uint32 spellId, bool triggered)
{
- if (!victim || (me->HasUnitState(UNIT_STAT_CASTING) && !triggered))
+ if (!victim || (me->HasUnitState(UNIT_STATE_CASTING) && !triggered))
return;
me->CastSpell(victim, spellId, triggered);
@@ -609,7 +609,7 @@ inline void UnitAI::DoCastVictim(uint32 spellId, bool triggered)
inline void UnitAI::DoCastAOE(uint32 spellId, bool triggered)
{
- if (!triggered && me->HasUnitState(UNIT_STAT_CASTING))
+ if (!triggered && me->HasUnitState(UNIT_STATE_CASTING))
return;
me->CastSpell((Unit*)NULL, spellId, triggered);
diff --git a/src/server/game/AI/EventAI/CreatureEventAI.cpp b/src/server/game/AI/EventAI/CreatureEventAI.cpp
index c507262bd3f..5db9d0b1cdb 100755
--- a/src/server/game/AI/EventAI/CreatureEventAI.cpp
+++ b/src/server/game/AI/EventAI/CreatureEventAI.cpp
@@ -577,7 +577,7 @@ void CreatureEventAI::ProcessAction(CreatureEventAI_Action const& action, uint32
{
if (action.combat_movement.melee)
{
- me->AddUnitState(UNIT_STAT_MELEE_ATTACKING);
+ me->AddUnitState(UNIT_STATE_MELEE_ATTACKING);
me->SendMeleeAttackStart(victim);
}
if (me->GetMotionMaster()->GetCurrentMovementGeneratorType() == IDLE_MOTION_TYPE)
@@ -591,7 +591,7 @@ void CreatureEventAI::ProcessAction(CreatureEventAI_Action const& action, uint32
Unit* victim = me->getVictim();
if (action.combat_movement.melee && victim)
{
- me->ClearUnitState(UNIT_STAT_MELEE_ATTACKING);
+ me->ClearUnitState(UNIT_STATE_MELEE_ATTACKING);
me->SendMeleeAttackStop(victim);
}
if (me->GetMotionMaster()->GetCurrentMovementGeneratorType() == CHASE_MOTION_TYPE)
diff --git a/src/server/game/AI/ScriptedAI/ScriptedCreature.cpp b/src/server/game/AI/ScriptedAI/ScriptedCreature.cpp
index 1b6fde6d132..bd6c901f99c 100644
--- a/src/server/game/AI/ScriptedAI/ScriptedCreature.cpp
+++ b/src/server/game/AI/ScriptedAI/ScriptedCreature.cpp
@@ -595,7 +595,7 @@ void BossAI::UpdateAI(uint32 const diff)
events.Update(diff);
- if (me->HasUnitState(UNIT_STAT_CASTING))
+ if (me->HasUnitState(UNIT_STATE_CASTING))
return;
while (uint32 eventId = events.ExecuteEvent())
@@ -654,7 +654,7 @@ void WorldBossAI::UpdateAI(uint32 const diff)
events.Update(diff);
- if (me->HasUnitState(UNIT_STAT_CASTING))
+ if (me->HasUnitState(UNIT_STATE_CASTING))
return;
while (uint32 eventId = events.ExecuteEvent())
diff --git a/src/server/game/AI/ScriptedAI/ScriptedEscortAI.cpp b/src/server/game/AI/ScriptedAI/ScriptedEscortAI.cpp
index c5f04d4ff5f..048cc8b3d68 100644
--- a/src/server/game/AI/ScriptedAI/ScriptedEscortAI.cpp
+++ b/src/server/game/AI/ScriptedAI/ScriptedEscortAI.cpp
@@ -90,7 +90,7 @@ bool npc_escortAI::AssistPlayerInCombat(Unit* who)
void npc_escortAI::MoveInLineOfSight(Unit* who)
{
- if (!me->HasUnitState(UNIT_STAT_STUNNED) && who->isTargetableForAttack() && who->isInAccessiblePlaceFor(me))
+ if (!me->HasUnitState(UNIT_STATE_STUNNED) && who->isTargetableForAttack() && who->isInAccessiblePlaceFor(me))
{
if (HasEscortState(STATE_ESCORT_ESCORTING) && AssistPlayerInCombat(who))
return;
diff --git a/src/server/game/AI/ScriptedAI/ScriptedFollowerAI.cpp b/src/server/game/AI/ScriptedAI/ScriptedFollowerAI.cpp
index 53747d0c799..d83ad9b756c 100644
--- a/src/server/game/AI/ScriptedAI/ScriptedFollowerAI.cpp
+++ b/src/server/game/AI/ScriptedAI/ScriptedFollowerAI.cpp
@@ -38,8 +38,8 @@ void FollowerAI::AttackStart(Unit* who)
me->SetInCombatWith(who);
who->SetInCombatWith(me);
- if (me->HasUnitState(UNIT_STAT_FOLLOW))
- me->ClearUnitState(UNIT_STAT_FOLLOW);
+ if (me->HasUnitState(UNIT_STATE_FOLLOW))
+ me->ClearUnitState(UNIT_STATE_FOLLOW);
if (IsCombatMovementAllowed())
me->GetMotionMaster()->MoveChase(who);
@@ -88,7 +88,7 @@ bool FollowerAI::AssistPlayerInCombat(Unit* who)
void FollowerAI::MoveInLineOfSight(Unit* who)
{
- if (!me->HasUnitState(UNIT_STAT_STUNNED) && who->isTargetableForAttack() && who->isInAccessiblePlaceFor(me))
+ if (!me->HasUnitState(UNIT_STATE_STUNNED) && who->isTargetableForAttack() && who->isInAccessiblePlaceFor(me))
{
if (HasFollowState(STATE_FOLLOW_INPROGRESS) && AssistPlayerInCombat(who))
return;
@@ -340,9 +340,9 @@ Player* FollowerAI::GetLeaderForFollower()
void FollowerAI::SetFollowComplete(bool bWithEndEvent)
{
- if (me->HasUnitState(UNIT_STAT_FOLLOW))
+ if (me->HasUnitState(UNIT_STATE_FOLLOW))
{
- me->ClearUnitState(UNIT_STAT_FOLLOW);
+ me->ClearUnitState(UNIT_STATE_FOLLOW);
me->StopMoving();
me->GetMotionMaster()->Clear();
@@ -369,9 +369,9 @@ void FollowerAI::SetFollowPaused(bool paused)
{
AddFollowState(STATE_FOLLOW_PAUSED);
- if (me->HasUnitState(UNIT_STAT_FOLLOW))
+ if (me->HasUnitState(UNIT_STATE_FOLLOW))
{
- me->ClearUnitState(UNIT_STAT_FOLLOW);
+ me->ClearUnitState(UNIT_STATE_FOLLOW);
me->StopMoving();
me->GetMotionMaster()->Clear();
diff --git a/src/server/game/AI/SmartScripts/SmartScript.cpp b/src/server/game/AI/SmartScripts/SmartScript.cpp
index 2b32946da17..a6923ea19e0 100644
--- a/src/server/game/AI/SmartScripts/SmartScript.cpp
+++ b/src/server/game/AI/SmartScripts/SmartScript.cpp
@@ -2718,7 +2718,7 @@ void SmartScript::UpdateTimer(SmartScriptHolder& e, uint32 const diff)
{
if (!(e.action.cast.flags & SMARTCAST_INTERRUPT_PREVIOUS))
{
- if (me && me->HasUnitState(UNIT_STAT_CASTING))
+ if (me && me->HasUnitState(UNIT_STATE_CASTING))
{
e.timer = 1;
return;