aboutsummaryrefslogtreecommitdiff
path: root/src/game/TargetedMovementGenerator.cpp
diff options
context:
space:
mode:
authormaximius <none@none>2009-09-11 13:58:23 -0700
committermaximius <none@none>2009-09-11 13:58:23 -0700
commitaf3a20823335cb29db47b996306a9ea8cefb011f (patch)
tree4114c8769a127c98f1c97cddfb764a088862b953 /src/game/TargetedMovementGenerator.cpp
parentb4a13eff5130bb9127d2898d280336a4a30b5661 (diff)
*[8465] Fixed exploit of z-axis described in http://getmangos.com/community/showthread.php?t=9652 Author: elecyb
Note: mostly just code cleanup, parts of this already seemed to be implemented, and some code that was updated in MaNGOS doesn't even exist in our code. --HG-- branch : trunk
Diffstat (limited to 'src/game/TargetedMovementGenerator.cpp')
-rw-r--r--src/game/TargetedMovementGenerator.cpp14
1 files changed, 7 insertions, 7 deletions
diff --git a/src/game/TargetedMovementGenerator.cpp b/src/game/TargetedMovementGenerator.cpp
index c14ed5ba75e..3b001c1ed3c 100644
--- a/src/game/TargetedMovementGenerator.cpp
+++ b/src/game/TargetedMovementGenerator.cpp
@@ -182,14 +182,14 @@ TargetedMovementGenerator<T>::Update(T &owner, const uint32 & time_diff)
if (!i_target.isValid() || !i_target->IsInWorld())
return false;
- if( !&owner || !owner.isAlive())
+ if (!&owner || !owner.isAlive())
return true;
- if( owner.hasUnitState(UNIT_STAT_ROOT | UNIT_STAT_STUNNED | UNIT_STAT_FLEEING | UNIT_STAT_DISTRACTED) )
+ if (owner.hasUnitState(UNIT_STAT_ROOT | UNIT_STAT_STUNNED | UNIT_STAT_FLEEING | UNIT_STAT_DISTRACTED))
return true;
// prevent movement while casting spells with cast time or channel time
- if(owner.hasUnitState(UNIT_STAT_CASTING))
+ if (owner.hasUnitState(UNIT_STAT_CASTING))
{
if (!owner.IsStopped())
owner.StopMoving();
@@ -202,9 +202,9 @@ TargetedMovementGenerator<T>::Update(T &owner, const uint32 & time_diff)
Traveller<T> traveller(owner);
- if( !i_destinationHolder.HasDestination() )
+ if (!i_destinationHolder.HasDestination())
_setTargetLocation(owner);
- else if( owner.IsStopped() && !i_destinationHolder.HasArrived() )
+ else if (owner.IsStopped() && !i_destinationHolder.HasArrived())
{
owner.addUnitState(UNIT_STAT_CHASE);
i_destinationHolder.StartTravel(traveller);
@@ -218,7 +218,7 @@ TargetedMovementGenerator<T>::Update(T &owner, const uint32 & time_diff)
//i_destinationHolder.ResetUpdate(50);
// target moved
- if(i_targetX != i_target->GetPositionX() || i_targetY != i_target->GetPositionY()
+ if (i_targetX != i_target->GetPositionX() || i_targetY != i_target->GetPositionY()
|| i_targetZ != i_target->GetPositionZ())
{
if(_setTargetLocation(owner) || !owner.hasUnitState(UNIT_STAT_FOLLOW))
@@ -226,7 +226,7 @@ TargetedMovementGenerator<T>::Update(T &owner, const uint32 & time_diff)
i_target->GetPosition(i_targetX, i_targetY, i_targetZ);
}
- if(( owner.IsStopped() && !i_destinationHolder.HasArrived() ) || i_recalculateTravel )
+ if ((owner.IsStopped() && !i_destinationHolder.HasArrived()) || i_recalculateTravel)
{
i_recalculateTravel = false;
//Angle update will take place into owner.StopMoving()