mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-26 03:42:37 +01:00
*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;
|
||||
CombatMovementEnabled = true;
|
||||
MeleeEnabled = true;
|
||||
AttackDistance = 0;
|
||||
AttackDistance = 0.0f;
|
||||
AttackAngle = 0.0f;
|
||||
|
||||
//Handle Spawned Events
|
||||
@@ -482,8 +482,8 @@ void CreatureEventAI::ProcessAction(CreatureEventAI_Action const& action, uint32
|
||||
{
|
||||
if (m_creature->GetMotionMaster()->GetCurrentMovementGeneratorType() == TARGETED_MOTION_TYPE)
|
||||
{
|
||||
AttackDistance = 0;
|
||||
AttackAngle = 0;
|
||||
AttackDistance = 0.0f;
|
||||
AttackAngle = 0.0f;
|
||||
|
||||
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);
|
||||
break;
|
||||
case ACTION_T_RANGED_MOVEMENT:
|
||||
AttackDistance = action.ranged_movement.distance;
|
||||
AttackAngle = ((float)action.ranged_movement.angle/180)*M_PI;
|
||||
AttackDistance = (float)action.ranged_movement.distance;
|
||||
AttackAngle = action.ranged_movement.angle/180.0f*M_PI;
|
||||
|
||||
if (CombatMovementEnabled)
|
||||
{
|
||||
|
||||
@@ -611,7 +611,7 @@ class TRINITY_DLL_SPEC CreatureEventAI : public CreatureAI
|
||||
uint8 Phase; //Current phase, max 32 phases
|
||||
bool CombatMovementEnabled; //If we allow targeted movment gen (movement twoards top threat)
|
||||
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
|
||||
};
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user