*Remove some unused code in movement generator.

--HG--
branch : trunk
This commit is contained in:
megamage
2009-08-26 13:39:11 -05:00
parent f13b3f4e58
commit 227471fe18
4 changed files with 2 additions and 21 deletions
-3
View File
@@ -33,9 +33,6 @@ void PointMovementGenerator<T>::Initialize(T &unit)
Traveller<T> traveller(unit);
// knockback effect has UNIT_STAT_JUMPING set,so if here we disable sentmonstermove there will be creature position sync problem between client and server
i_destinationHolder.SetDestination(traveller,i_x,i_y,i_z, true /* !unit.hasUnitState(UNIT_STAT_JUMPING)*/);
if (unit.GetTypeId() == TYPEID_UNIT && ((Creature*)&unit)->canFly())
unit.AddUnitMovementFlag(MOVEMENTFLAG_FLYING);
}
template<class T>
+2 -7
View File
@@ -123,7 +123,6 @@ RandomMovementGenerator<Creature>::_setRandomLocation(Creature &creature)
if (is_air_ok)
{
i_nextMoveTime.Reset(i_destinationHolder.GetTotalTravelTime());
creature.AddUnitMovementFlag(MOVEMENTFLAG_FLYING);
}
//else if (is_water_ok) // Swimming mode to be done with more than this check
else
@@ -149,9 +148,7 @@ RandomMovementGenerator<Creature>::Initialize(Creature &creature)
if(!wander_distance)
wander_distance = creature.GetRespawnRadius();
if (creature.canFly())
creature.AddUnitMovementFlag(MOVEMENTFLAG_FLYING);
else if(irand(0,RUNNING_CHANCE_RANDOMMV) > 0)
if(irand(0,RUNNING_CHANCE_RANDOMMV) > 0)
creature.AddUnitMovementFlag(MOVEMENTFLAG_WALK_MODE);
_setRandomLocation(creature);
}
@@ -192,9 +189,7 @@ RandomMovementGenerator<Creature>::Update(Creature &creature, const uint32 &diff
{
if(i_nextMoveTime.Passed())
{
if (creature.canFly())
creature.AddUnitMovementFlag(MOVEMENTFLAG_FLYING);
else if(irand(0,RUNNING_CHANCE_RANDOMMV) > 0)
if(irand(0,RUNNING_CHANCE_RANDOMMV) > 0)
creature.AddUnitMovementFlag(MOVEMENTFLAG_WALK_MODE);
_setRandomLocation(creature);
}
-8
View File
@@ -144,8 +144,6 @@ TargetedMovementGenerator<T>::_setTargetLocation(T &owner)
*/
i_destinationHolder.SetDestination(traveller, x, y, z);
owner.addUnitState(UNIT_STAT_CHASE);
if (owner.GetTypeId() == TYPEID_UNIT && ((Creature*)&owner)->canFly())
owner.AddUnitMovementFlag(MOVEMENTFLAG_FLYING);
i_destinationHolder.StartTravel(traveller);
return true;
}
@@ -159,9 +157,6 @@ TargetedMovementGenerator<T>::Initialize(T &owner)
else
owner.RemoveUnitMovementFlag(MOVEMENTFLAG_WALK_MODE);
if (owner.GetTypeId() == TYPEID_UNIT && ((Creature*)&owner)->canFly())
owner.AddUnitMovementFlag(MOVEMENTFLAG_FLYING);
_setTargetLocation(owner);
}
@@ -211,9 +206,6 @@ TargetedMovementGenerator<T>::Update(T &owner, const uint32 & time_diff)
else if( owner.IsStopped() && !i_destinationHolder.HasArrived() )
{
owner.addUnitState(UNIT_STAT_CHASE);
if (owner.GetTypeId() == TYPEID_UNIT && ((Creature*)&owner)->canFly())
owner.AddUnitMovementFlag(MOVEMENTFLAG_FLYING);
i_destinationHolder.StartTravel(traveller);
return true;
}
-3
View File
@@ -85,9 +85,6 @@ void WaypointMovementGenerator<Creature>::InitTraveller(Creature &unit, const Wa
unit.SetUInt32Value(UNIT_NPC_EMOTESTATE, 0);
unit.SetUInt32Value(UNIT_FIELD_BYTES_1, 0);
if(unit.canFly())
unit.AddUnitMovementFlag(MOVEMENTFLAG_FLYING);
unit.addUnitState(UNIT_STAT_ROAMING);
}