diff options
author | megamage <none@none> | 2009-06-19 17:34:24 -0500 |
---|---|---|
committer | megamage <none@none> | 2009-06-19 17:34:24 -0500 |
commit | 8adfaceadffbb66768ed5b0e3284c0ee46363a36 (patch) | |
tree | d094d7e7017e592f9aa22749334234f949302c99 /src | |
parent | 39d3b492fe78cf50c147ce0e017614be6b074741 (diff) |
*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
Diffstat (limited to 'src')
-rw-r--r-- | src/game/CreatureEventAI.cpp | 10 | ||||
-rw-r--r-- | src/game/CreatureEventAI.h | 2 |
2 files changed, 6 insertions, 6 deletions
diff --git a/src/game/CreatureEventAI.cpp b/src/game/CreatureEventAI.cpp index 8aa4cf38b49..0393c30e7d3 100644 --- a/src/game/CreatureEventAI.cpp +++ b/src/game/CreatureEventAI.cpp @@ -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) { diff --git a/src/game/CreatureEventAI.h b/src/game/CreatureEventAI.h index ccfd997d9f7..ad3827ef75d 100644 --- a/src/game/CreatureEventAI.h +++ b/src/game/CreatureEventAI.h @@ -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 |