*Some cleanup of eventAI.
[8046] Use float for store AttackDistance as expected by using calls. Author: NoFantasy [8045] Cleanup expression. Author: VladimirMangos --HG-- branch : trunk
This commit is contained in:
@@ -92,7 +92,7 @@ CreatureEventAI::CreatureEventAI(Creature *c ) : CreatureAI(c)
|
|||||||
Phase = 0;
|
Phase = 0;
|
||||||
CombatMovementEnabled = true;
|
CombatMovementEnabled = true;
|
||||||
MeleeEnabled = true;
|
MeleeEnabled = true;
|
||||||
AttackDistance = 0;
|
AttackDistance = 0.0f;
|
||||||
AttackAngle = 0.0f;
|
AttackAngle = 0.0f;
|
||||||
|
|
||||||
//Handle Spawned Events
|
//Handle Spawned Events
|
||||||
@@ -482,8 +482,8 @@ void CreatureEventAI::ProcessAction(CreatureEventAI_Action const& action, uint32
|
|||||||
{
|
{
|
||||||
if (m_creature->GetMotionMaster()->GetCurrentMovementGeneratorType() == TARGETED_MOTION_TYPE)
|
if (m_creature->GetMotionMaster()->GetCurrentMovementGeneratorType() == TARGETED_MOTION_TYPE)
|
||||||
{
|
{
|
||||||
AttackDistance = 0;
|
AttackDistance = 0.0f;
|
||||||
AttackAngle = 0;
|
AttackAngle = 0.0f;
|
||||||
|
|
||||||
m_creature->GetMotionMaster()->MoveChase(m_creature->getVictim(), AttackDistance, AttackAngle);
|
m_creature->GetMotionMaster()->MoveChase(m_creature->getVictim(), AttackDistance, AttackAngle);
|
||||||
}
|
}
|
||||||
@@ -642,8 +642,8 @@ void CreatureEventAI::ProcessAction(CreatureEventAI_Action const& action, uint32
|
|||||||
target->RemoveAurasDueToSpell(action.remove_aura.spellId);
|
target->RemoveAurasDueToSpell(action.remove_aura.spellId);
|
||||||
break;
|
break;
|
||||||
case ACTION_T_RANGED_MOVEMENT:
|
case ACTION_T_RANGED_MOVEMENT:
|
||||||
AttackDistance = action.ranged_movement.distance;
|
AttackDistance = (float)action.ranged_movement.distance;
|
||||||
AttackAngle = ((float)action.ranged_movement.angle/180)*M_PI;
|
AttackAngle = action.ranged_movement.angle/180.0f*M_PI;
|
||||||
|
|
||||||
if (CombatMovementEnabled)
|
if (CombatMovementEnabled)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -611,7 +611,7 @@ class TRINITY_DLL_SPEC CreatureEventAI : public CreatureAI
|
|||||||
uint8 Phase; //Current phase, max 32 phases
|
uint8 Phase; //Current phase, max 32 phases
|
||||||
bool CombatMovementEnabled; //If we allow targeted movment gen (movement twoards top threat)
|
bool CombatMovementEnabled; //If we allow targeted movment gen (movement twoards top threat)
|
||||||
bool MeleeEnabled; //If we allow melee auto attack
|
bool MeleeEnabled; //If we allow melee auto attack
|
||||||
uint32 AttackDistance; //Distance to attack from
|
float AttackDistance; //Distance to attack from
|
||||||
float AttackAngle; //Angle of attack
|
float AttackAngle; //Angle of attack
|
||||||
};
|
};
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
Reference in New Issue
Block a user