aboutsummaryrefslogtreecommitdiff
path: root/src/game/RandomMovementGenerator.cpp
diff options
context:
space:
mode:
authorSpp <none@none>2010-04-07 19:14:10 +0200
committerSpp <none@none>2010-04-07 19:14:10 +0200
commitd19e12708001fbef2308be0e8cb5375a2ac7af48 (patch)
tree09fc8f67a6197802e0512950f0b0a3438a9834e8 /src/game/RandomMovementGenerator.cpp
parent2e127f7a30706dc1d40c65de22ff02851732da24 (diff)
Code style (game + scripts only):
"if(" --> "if (" --HG-- branch : trunk
Diffstat (limited to 'src/game/RandomMovementGenerator.cpp')
-rw-r--r--src/game/RandomMovementGenerator.cpp26
1 files changed, 13 insertions, 13 deletions
diff --git a/src/game/RandomMovementGenerator.cpp b/src/game/RandomMovementGenerator.cpp
index dabb030878f..49abb2b13d2 100644
--- a/src/game/RandomMovementGenerator.cpp
+++ b/src/game/RandomMovementGenerator.cpp
@@ -34,7 +34,7 @@ template<>
bool
RandomMovementGenerator<Creature>::GetDestination(float &x, float &y, float &z) const
{
- if(i_destinationHolder.HasArrived())
+ if (i_destinationHolder.HasArrived())
return false;
i_destinationHolder.GetDestination(x, y, z);
@@ -78,7 +78,7 @@ RandomMovementGenerator<Creature>::_setRandomLocation(Creature &creature)
dist = (nx - X)*(nx - X) + (ny - Y)*(ny - Y);
- if(i == 5)
+ if (i == 5)
{
nz = Z;
break;
@@ -132,7 +132,7 @@ RandomMovementGenerator<Creature>::_setRandomLocation(Creature &creature)
}
//Call for creature group update
- if(creature.GetFormation() && creature.GetFormation()->getLeader() == &creature)
+ if (creature.GetFormation() && creature.GetFormation()->getLeader() == &creature)
{
creature.GetFormation()->LeaderMoveTo(nx, ny, nz);
}
@@ -142,13 +142,13 @@ template<>
void
RandomMovementGenerator<Creature>::Initialize(Creature &creature)
{
- if(!creature.isAlive())
+ if (!creature.isAlive())
return;
- if(!wander_distance)
+ if (!wander_distance)
wander_distance = creature.GetRespawnRadius();
- if(irand(0,RUNNING_CHANCE_RANDOMMV) > 0)
+ if (irand(0,RUNNING_CHANCE_RANDOMMV) > 0)
creature.AddUnitMovementFlag(MOVEMENTFLAG_WALK_MODE);
_setRandomLocation(creature);
}
@@ -168,7 +168,7 @@ template<>
bool
RandomMovementGenerator<Creature>::Update(Creature &creature, const uint32 &diff)
{
- if(creature.hasUnitState(UNIT_STAT_ROOT | UNIT_STAT_STUNNED | UNIT_STAT_DISTRACTED))
+ if (creature.hasUnitState(UNIT_STAT_ROOT | UNIT_STAT_STUNNED | UNIT_STAT_DISTRACTED))
{
i_nextMoveTime.Update(i_nextMoveTime.GetExpiry()); // Expire the timer
creature.clearUnitState(UNIT_STAT_ROAMING);
@@ -177,23 +177,23 @@ RandomMovementGenerator<Creature>::Update(Creature &creature, const uint32 &diff
i_nextMoveTime.Update(diff);
- if(i_destinationHolder.HasArrived() && !creature.IsStopped() && !creature.canFly())
+ if (i_destinationHolder.HasArrived() && !creature.IsStopped() && !creature.canFly())
creature.clearUnitState(UNIT_STAT_ROAMING | UNIT_STAT_MOVE);
- if(!i_destinationHolder.HasArrived() && creature.IsStopped())
+ if (!i_destinationHolder.HasArrived() && creature.IsStopped())
creature.addUnitState(UNIT_STAT_ROAMING);
CreatureTraveller traveller(creature);
- if( i_destinationHolder.UpdateTraveller(traveller, diff, true) )
+ if ( i_destinationHolder.UpdateTraveller(traveller, diff, true) )
{
- if(i_nextMoveTime.Passed())
+ if (i_nextMoveTime.Passed())
{
- if(irand(0,RUNNING_CHANCE_RANDOMMV) > 0)
+ if (irand(0,RUNNING_CHANCE_RANDOMMV) > 0)
creature.AddUnitMovementFlag(MOVEMENTFLAG_WALK_MODE);
_setRandomLocation(creature);
}
- else if(creature.isPet() && creature.GetOwner() && !creature.IsWithinDist(creature.GetOwner(),PET_FOLLOW_DIST+2.5f))
+ else if (creature.isPet() && creature.GetOwner() && !creature.IsWithinDist(creature.GetOwner(),PET_FOLLOW_DIST+2.5f))
{
creature.RemoveUnitMovementFlag(MOVEMENTFLAG_WALK_MODE);
_setRandomLocation(creature);