Core/Misc: Rename UNIT_STAT_* enums to UNIT_STATE_*
This commit is contained in:
@@ -71,7 +71,7 @@ void ConfusedMovementGenerator<T>::Initialize(T &unit)
|
||||
|
||||
unit.StopMoving();
|
||||
unit.SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_CONFUSED);
|
||||
unit.AddUnitState(UNIT_STAT_CONFUSED|UNIT_STAT_CONFUSED_MOVE);
|
||||
unit.AddUnitState(UNIT_STATE_CONFUSED|UNIT_STATE_CONFUSED_MOVE);
|
||||
}
|
||||
|
||||
template<>
|
||||
@@ -94,19 +94,19 @@ void ConfusedMovementGenerator<T>::Reset(T &unit)
|
||||
i_nextMove = 1;
|
||||
i_nextMoveTime.Reset(0);
|
||||
unit.StopMoving();
|
||||
unit.AddUnitState(UNIT_STAT_CONFUSED|UNIT_STAT_CONFUSED_MOVE);
|
||||
unit.AddUnitState(UNIT_STATE_CONFUSED|UNIT_STATE_CONFUSED_MOVE);
|
||||
}
|
||||
|
||||
template<class T>
|
||||
bool ConfusedMovementGenerator<T>::Update(T &unit, const uint32 &diff)
|
||||
{
|
||||
if (unit.HasUnitState(UNIT_STAT_ROOT | UNIT_STAT_STUNNED | UNIT_STAT_DISTRACTED))
|
||||
if (unit.HasUnitState(UNIT_STATE_ROOT | UNIT_STATE_STUNNED | UNIT_STATE_DISTRACTED))
|
||||
return true;
|
||||
|
||||
if (i_nextMoveTime.Passed())
|
||||
{
|
||||
// currently moving, update location
|
||||
unit.AddUnitState(UNIT_STAT_CONFUSED_MOVE);
|
||||
unit.AddUnitState(UNIT_STATE_CONFUSED_MOVE);
|
||||
|
||||
if (unit.movespline->Finalized())
|
||||
{
|
||||
@@ -121,7 +121,7 @@ bool ConfusedMovementGenerator<T>::Update(T &unit, const uint32 &diff)
|
||||
if(i_nextMoveTime.Passed() )
|
||||
{
|
||||
// start moving
|
||||
unit.AddUnitState(UNIT_STAT_CONFUSED_MOVE);
|
||||
unit.AddUnitState(UNIT_STATE_CONFUSED_MOVE);
|
||||
|
||||
ASSERT( i_nextMove <= MAX_CONF_WAYPOINTS );
|
||||
float x = i_waypoints[i_nextMove][0];
|
||||
@@ -141,14 +141,14 @@ template<>
|
||||
void ConfusedMovementGenerator<Player>::Finalize(Player &unit)
|
||||
{
|
||||
unit.RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_CONFUSED);
|
||||
unit.ClearUnitState(UNIT_STAT_CONFUSED|UNIT_STAT_CONFUSED_MOVE);
|
||||
unit.ClearUnitState(UNIT_STATE_CONFUSED|UNIT_STATE_CONFUSED_MOVE);
|
||||
}
|
||||
|
||||
template<>
|
||||
void ConfusedMovementGenerator<Creature>::Finalize(Creature &unit)
|
||||
{
|
||||
unit.RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_CONFUSED);
|
||||
unit.ClearUnitState(UNIT_STAT_CONFUSED|UNIT_STAT_CONFUSED_MOVE);
|
||||
unit.ClearUnitState(UNIT_STATE_CONFUSED|UNIT_STATE_CONFUSED_MOVE);
|
||||
if (unit.getVictim())
|
||||
unit.SetTarget(unit.getVictim()->GetGUID());
|
||||
}
|
||||
|
||||
@@ -34,7 +34,7 @@ FleeingMovementGenerator<T>::_setTargetLocation(T &owner)
|
||||
if (!&owner)
|
||||
return;
|
||||
|
||||
if (owner.HasUnitState(UNIT_STAT_ROOT | UNIT_STAT_STUNNED))
|
||||
if (owner.HasUnitState(UNIT_STATE_ROOT | UNIT_STATE_STUNNED))
|
||||
return;
|
||||
|
||||
if (!_setMoveData(owner))
|
||||
@@ -44,7 +44,7 @@ FleeingMovementGenerator<T>::_setTargetLocation(T &owner)
|
||||
if (!_getPoint(owner, x, y, z))
|
||||
return;
|
||||
|
||||
owner.AddUnitState(UNIT_STAT_FLEEING_MOVE);
|
||||
owner.AddUnitState(UNIT_STATE_FLEEING_MOVE);
|
||||
|
||||
Movement::MoveSplineInit init(owner);
|
||||
init.MoveTo(x,y,z);
|
||||
@@ -287,7 +287,7 @@ FleeingMovementGenerator<T>::Initialize(T &owner)
|
||||
return;
|
||||
|
||||
owner.SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_FLEEING);
|
||||
owner.AddUnitState(UNIT_STAT_FLEEING|UNIT_STAT_FLEEING_MOVE);
|
||||
owner.AddUnitState(UNIT_STATE_FLEEING|UNIT_STATE_FLEEING_MOVE);
|
||||
|
||||
_Init(owner);
|
||||
|
||||
@@ -335,14 +335,14 @@ template<>
|
||||
void FleeingMovementGenerator<Player>::Finalize(Player &owner)
|
||||
{
|
||||
owner.RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_FLEEING);
|
||||
owner.ClearUnitState(UNIT_STAT_FLEEING|UNIT_STAT_FLEEING_MOVE);
|
||||
owner.ClearUnitState(UNIT_STATE_FLEEING|UNIT_STATE_FLEEING_MOVE);
|
||||
}
|
||||
|
||||
template<>
|
||||
void FleeingMovementGenerator<Creature>::Finalize(Creature &owner)
|
||||
{
|
||||
owner.RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_FLEEING);
|
||||
owner.ClearUnitState(UNIT_STAT_FLEEING|UNIT_STAT_FLEEING_MOVE);
|
||||
owner.ClearUnitState(UNIT_STATE_FLEEING|UNIT_STATE_FLEEING_MOVE);
|
||||
if (owner.getVictim())
|
||||
owner.SetTarget(owner.getVictim()->GetGUID());
|
||||
}
|
||||
@@ -359,9 +359,9 @@ FleeingMovementGenerator<T>::Update(T &owner, const uint32 &time_diff)
|
||||
{
|
||||
if (!&owner || !owner.isAlive())
|
||||
return false;
|
||||
if (owner.HasUnitState(UNIT_STAT_ROOT | UNIT_STAT_STUNNED))
|
||||
if (owner.HasUnitState(UNIT_STATE_ROOT | UNIT_STATE_STUNNED))
|
||||
{
|
||||
owner.ClearUnitState(UNIT_STAT_FLEEING_MOVE);
|
||||
owner.ClearUnitState(UNIT_STATE_FLEEING_MOVE);
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -388,7 +388,7 @@ template bool FleeingMovementGenerator<Creature>::Update(Creature &, const uint3
|
||||
void TimedFleeingMovementGenerator::Finalize(Unit &owner)
|
||||
{
|
||||
owner.RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_FLEEING);
|
||||
owner.ClearUnitState(UNIT_STAT_FLEEING|UNIT_STAT_FLEEING_MOVE);
|
||||
owner.ClearUnitState(UNIT_STATE_FLEEING|UNIT_STATE_FLEEING_MOVE);
|
||||
if (Unit* victim = owner.getVictim())
|
||||
{
|
||||
if (owner.isAlive())
|
||||
@@ -404,9 +404,9 @@ bool TimedFleeingMovementGenerator::Update(Unit & owner, const uint32 time_diff)
|
||||
if (!owner.isAlive())
|
||||
return false;
|
||||
|
||||
if (owner.HasUnitState(UNIT_STAT_ROOT | UNIT_STAT_STUNNED))
|
||||
if (owner.HasUnitState(UNIT_STATE_ROOT | UNIT_STATE_STUNNED))
|
||||
{
|
||||
owner.ClearUnitState(UNIT_STAT_FLEEING_MOVE);
|
||||
owner.ClearUnitState(UNIT_STATE_FLEEING_MOVE);
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
@@ -25,7 +25,7 @@
|
||||
|
||||
void HomeMovementGenerator<Creature>::Initialize(Creature & owner)
|
||||
{
|
||||
owner.AddUnitState(UNIT_STAT_EVADE);
|
||||
owner.AddUnitState(UNIT_STATE_EVADE);
|
||||
_setTargetLocation(owner);
|
||||
}
|
||||
|
||||
@@ -38,7 +38,7 @@ void HomeMovementGenerator<Creature>::_setTargetLocation(Creature & owner)
|
||||
if (!&owner)
|
||||
return;
|
||||
|
||||
if (owner.HasUnitState(UNIT_STAT_ROOT | UNIT_STAT_STUNNED | UNIT_STAT_DISTRACTED))
|
||||
if (owner.HasUnitState(UNIT_STATE_ROOT | UNIT_STATE_STUNNED | UNIT_STATE_DISTRACTED))
|
||||
return;
|
||||
|
||||
Movement::MoveSplineInit init(owner);
|
||||
@@ -54,7 +54,7 @@ void HomeMovementGenerator<Creature>::_setTargetLocation(Creature & owner)
|
||||
init.Launch();
|
||||
|
||||
arrived = false;
|
||||
owner.ClearUnitState(UNIT_STAT_ALL_STATE & ~UNIT_STAT_EVADE);
|
||||
owner.ClearUnitState(UNIT_STATE_ALL_STATE & ~UNIT_STATE_EVADE);
|
||||
}
|
||||
|
||||
bool HomeMovementGenerator<Creature>::Update(Creature &owner, const uint32 time_diff)
|
||||
@@ -67,7 +67,7 @@ void HomeMovementGenerator<Creature>::Finalize(Creature& owner)
|
||||
{
|
||||
if (arrived)
|
||||
{
|
||||
owner.ClearUnitState(UNIT_STAT_EVADE);
|
||||
owner.ClearUnitState(UNIT_STATE_EVADE);
|
||||
owner.SetWalk(true);
|
||||
owner.LoadCreaturesAddon(true);
|
||||
owner.AI()->JustReachedHome();
|
||||
|
||||
@@ -32,19 +32,19 @@ void IdleMovementGenerator::Initialize(Unit &owner)
|
||||
void
|
||||
IdleMovementGenerator::Reset(Unit& owner)
|
||||
{
|
||||
if (owner.HasUnitState(UNIT_STAT_MOVE))
|
||||
if (owner.HasUnitState(UNIT_STATE_MOVE))
|
||||
owner.StopMoving();
|
||||
}
|
||||
|
||||
void RotateMovementGenerator::Initialize(Unit& owner)
|
||||
{
|
||||
if (owner.HasUnitState(UNIT_STAT_MOVE))
|
||||
if (owner.HasUnitState(UNIT_STATE_MOVE))
|
||||
owner.StopMoving();
|
||||
|
||||
if (owner.getVictim())
|
||||
owner.SetInFront(owner.getVictim());
|
||||
|
||||
owner.AddUnitState(UNIT_STAT_ROTATING);
|
||||
owner.AddUnitState(UNIT_STATE_ROTATING);
|
||||
|
||||
owner.AttackStop();
|
||||
}
|
||||
@@ -75,7 +75,7 @@ bool RotateMovementGenerator::Update(Unit& owner, const uint32 diff)
|
||||
|
||||
void RotateMovementGenerator::Finalize(Unit &unit)
|
||||
{
|
||||
unit.ClearUnitState(UNIT_STAT_ROTATING);
|
||||
unit.ClearUnitState(UNIT_STATE_ROTATING);
|
||||
if (unit.GetTypeId() == TYPEID_UNIT)
|
||||
unit.ToCreature()->AI()->MovementInform(ROTATE_MOTION_TYPE, 0);
|
||||
}
|
||||
@@ -83,13 +83,13 @@ void RotateMovementGenerator::Finalize(Unit &unit)
|
||||
void
|
||||
DistractMovementGenerator::Initialize(Unit& owner)
|
||||
{
|
||||
owner.AddUnitState(UNIT_STAT_DISTRACTED);
|
||||
owner.AddUnitState(UNIT_STATE_DISTRACTED);
|
||||
}
|
||||
|
||||
void
|
||||
DistractMovementGenerator::Finalize(Unit& owner)
|
||||
{
|
||||
owner.ClearUnitState(UNIT_STAT_DISTRACTED);
|
||||
owner.ClearUnitState(UNIT_STATE_DISTRACTED);
|
||||
}
|
||||
|
||||
bool
|
||||
@@ -105,7 +105,7 @@ DistractMovementGenerator::Update(Unit& /*owner*/, const uint32 time_diff)
|
||||
void
|
||||
AssistanceDistractMovementGenerator::Finalize(Unit &unit)
|
||||
{
|
||||
unit.ClearUnitState(UNIT_STAT_DISTRACTED);
|
||||
unit.ClearUnitState(UNIT_STATE_DISTRACTED);
|
||||
unit.ToCreature()->SetReactState(REACT_AGGRESSIVE);
|
||||
}
|
||||
|
||||
|
||||
@@ -32,7 +32,7 @@ void PointMovementGenerator<T>::Initialize(T &unit)
|
||||
if (!unit.IsStopped())
|
||||
unit.StopMoving();
|
||||
|
||||
unit.AddUnitState(UNIT_STAT_ROAMING|UNIT_STAT_ROAMING_MOVE);
|
||||
unit.AddUnitState(UNIT_STATE_ROAMING|UNIT_STATE_ROAMING_MOVE);
|
||||
Movement::MoveSplineInit init(unit);
|
||||
init.MoveTo(i_x, i_y, i_z);
|
||||
if (speed > 0.0f)
|
||||
@@ -46,20 +46,20 @@ bool PointMovementGenerator<T>::Update(T &unit, const uint32 &diff)
|
||||
if (!&unit)
|
||||
return false;
|
||||
|
||||
if(unit.HasUnitState(UNIT_STAT_ROOT | UNIT_STAT_STUNNED))
|
||||
if(unit.HasUnitState(UNIT_STATE_ROOT | UNIT_STATE_STUNNED))
|
||||
{
|
||||
unit.ClearUnitState(UNIT_STAT_ROAMING_MOVE);
|
||||
unit.ClearUnitState(UNIT_STATE_ROAMING_MOVE);
|
||||
return true;
|
||||
}
|
||||
|
||||
unit.AddUnitState(UNIT_STAT_ROAMING_MOVE);
|
||||
unit.AddUnitState(UNIT_STATE_ROAMING_MOVE);
|
||||
return !unit.movespline->Finalized();
|
||||
}
|
||||
|
||||
template<class T>
|
||||
void PointMovementGenerator<T>:: Finalize(T &unit)
|
||||
{
|
||||
unit.ClearUnitState(UNIT_STAT_ROAMING|UNIT_STAT_ROAMING_MOVE);
|
||||
unit.ClearUnitState(UNIT_STATE_ROAMING|UNIT_STATE_ROAMING_MOVE);
|
||||
|
||||
if (unit.movespline->Finalized())
|
||||
MovementInform(unit);
|
||||
@@ -71,7 +71,7 @@ void PointMovementGenerator<T>::Reset(T &unit)
|
||||
if (!unit.IsStopped())
|
||||
unit.StopMoving();
|
||||
|
||||
unit.AddUnitState(UNIT_STAT_ROAMING|UNIT_STAT_ROAMING_MOVE);
|
||||
unit.AddUnitState(UNIT_STATE_ROAMING|UNIT_STATE_ROAMING_MOVE);
|
||||
}
|
||||
|
||||
template<class T>
|
||||
@@ -120,7 +120,7 @@ void EffectMovementGenerator::Finalize(Unit &unit)
|
||||
if (((Creature&)unit).AI() && unit.movespline->Finalized())
|
||||
((Creature&)unit).AI()->MovementInform(EFFECT_MOTION_TYPE, m_Id);
|
||||
// Need restore previous movement since we have no proper states system
|
||||
//if (unit.isAlive() && !unit.HasUnitState(UNIT_STAT_CONFUSED|UNIT_STAT_FLEEING))
|
||||
//if (unit.isAlive() && !unit.HasUnitState(UNIT_STATE_CONFUSED|UNIT_STATE_FLEEING))
|
||||
//{
|
||||
// if (Unit * victim = unit.getVictim())
|
||||
// unit.GetMotionMaster()->MoveChase(victim);
|
||||
|
||||
@@ -102,7 +102,7 @@ void RandomMovementGenerator<Creature>::_setRandomLocation(Creature &creature)
|
||||
else
|
||||
i_nextMoveTime.Reset(urand(500, 10000));
|
||||
|
||||
creature.AddUnitState(UNIT_STAT_ROAMING_MOVE);
|
||||
creature.AddUnitState(UNIT_STATE_ROAMING_MOVE);
|
||||
|
||||
Movement::MoveSplineInit init(creature);
|
||||
init.MoveTo(destX, destY, destZ);
|
||||
@@ -123,7 +123,7 @@ void RandomMovementGenerator<Creature>::Initialize(Creature &creature)
|
||||
if (!wander_distance)
|
||||
wander_distance = creature.GetRespawnRadius();
|
||||
|
||||
creature.AddUnitState(UNIT_STAT_ROAMING|UNIT_STAT_ROAMING_MOVE);
|
||||
creature.AddUnitState(UNIT_STATE_ROAMING|UNIT_STATE_ROAMING_MOVE);
|
||||
_setRandomLocation(creature);
|
||||
}
|
||||
|
||||
@@ -137,7 +137,7 @@ RandomMovementGenerator<Creature>::Reset(Creature &creature)
|
||||
template<>
|
||||
void RandomMovementGenerator<Creature>::Finalize(Creature &creature)
|
||||
{
|
||||
creature.ClearUnitState(UNIT_STAT_ROAMING|UNIT_STAT_ROAMING_MOVE);
|
||||
creature.ClearUnitState(UNIT_STATE_ROAMING|UNIT_STATE_ROAMING_MOVE);
|
||||
creature.SetWalk(false);
|
||||
}
|
||||
|
||||
@@ -145,10 +145,10 @@ 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_STATE_ROOT | UNIT_STATE_STUNNED | UNIT_STATE_DISTRACTED))
|
||||
{
|
||||
i_nextMoveTime.Reset(0); // Expire the timer
|
||||
creature.ClearUnitState(UNIT_STAT_ROAMING_MOVE);
|
||||
creature.ClearUnitState(UNIT_STATE_ROAMING_MOVE);
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
@@ -34,7 +34,7 @@ void TargetedMovementGeneratorMedium<T,D>::_setTargetLocation(T &owner)
|
||||
if (!i_target.isValid() || !i_target->IsInWorld())
|
||||
return;
|
||||
|
||||
if (owner.HasUnitState(UNIT_STAT_NOT_MOVE))
|
||||
if (owner.HasUnitState(UNIT_STATE_NOT_MOVE))
|
||||
return;
|
||||
|
||||
float x, y, z;
|
||||
@@ -125,7 +125,7 @@ bool TargetedMovementGeneratorMedium<T,D>::Update(T &owner, const uint32 & time_
|
||||
if (!owner.isAlive())
|
||||
return true;
|
||||
|
||||
if (owner.HasUnitState(UNIT_STAT_NOT_MOVE))
|
||||
if (owner.HasUnitState(UNIT_STATE_NOT_MOVE))
|
||||
{
|
||||
D::_clearUnitStateMove(owner);
|
||||
return true;
|
||||
@@ -188,7 +188,7 @@ void ChaseMovementGenerator<T>::_reachTarget(T &owner)
|
||||
template<>
|
||||
void ChaseMovementGenerator<Player>::Initialize(Player &owner)
|
||||
{
|
||||
owner.AddUnitState(UNIT_STAT_CHASE|UNIT_STAT_CHASE_MOVE);
|
||||
owner.AddUnitState(UNIT_STATE_CHASE|UNIT_STATE_CHASE_MOVE);
|
||||
_setTargetLocation(owner);
|
||||
}
|
||||
|
||||
@@ -196,14 +196,14 @@ template<>
|
||||
void ChaseMovementGenerator<Creature>::Initialize(Creature &owner)
|
||||
{
|
||||
owner.SetWalk(false);
|
||||
owner.AddUnitState(UNIT_STAT_CHASE|UNIT_STAT_CHASE_MOVE);
|
||||
owner.AddUnitState(UNIT_STATE_CHASE|UNIT_STATE_CHASE_MOVE);
|
||||
_setTargetLocation(owner);
|
||||
}
|
||||
|
||||
template<class T>
|
||||
void ChaseMovementGenerator<T>::Finalize(T &owner)
|
||||
{
|
||||
owner.ClearUnitState(UNIT_STAT_CHASE|UNIT_STAT_CHASE_MOVE);
|
||||
owner.ClearUnitState(UNIT_STATE_CHASE|UNIT_STATE_CHASE_MOVE);
|
||||
}
|
||||
|
||||
template<class T>
|
||||
@@ -259,7 +259,7 @@ void FollowMovementGenerator<Creature>::_updateSpeed(Creature &u)
|
||||
template<>
|
||||
void FollowMovementGenerator<Player>::Initialize(Player &owner)
|
||||
{
|
||||
owner.AddUnitState(UNIT_STAT_FOLLOW|UNIT_STAT_FOLLOW_MOVE);
|
||||
owner.AddUnitState(UNIT_STATE_FOLLOW|UNIT_STATE_FOLLOW_MOVE);
|
||||
_updateSpeed(owner);
|
||||
_setTargetLocation(owner);
|
||||
}
|
||||
@@ -267,7 +267,7 @@ void FollowMovementGenerator<Player>::Initialize(Player &owner)
|
||||
template<>
|
||||
void FollowMovementGenerator<Creature>::Initialize(Creature &owner)
|
||||
{
|
||||
owner.AddUnitState(UNIT_STAT_FOLLOW|UNIT_STAT_FOLLOW_MOVE);
|
||||
owner.AddUnitState(UNIT_STATE_FOLLOW|UNIT_STATE_FOLLOW_MOVE);
|
||||
_updateSpeed(owner);
|
||||
_setTargetLocation(owner);
|
||||
}
|
||||
@@ -275,7 +275,7 @@ void FollowMovementGenerator<Creature>::Initialize(Creature &owner)
|
||||
template<class T>
|
||||
void FollowMovementGenerator<T>::Finalize(T &owner)
|
||||
{
|
||||
owner.ClearUnitState(UNIT_STAT_FOLLOW|UNIT_STAT_FOLLOW_MOVE);
|
||||
owner.ClearUnitState(UNIT_STATE_FOLLOW|UNIT_STATE_FOLLOW_MOVE);
|
||||
_updateSpeed(owner);
|
||||
}
|
||||
|
||||
|
||||
@@ -79,8 +79,8 @@ class ChaseMovementGenerator : public TargetedMovementGeneratorMedium<T, ChaseMo
|
||||
void Reset(T &);
|
||||
void MovementInform(T &);
|
||||
|
||||
static void _clearUnitStateMove(T &u) { u.ClearUnitState(UNIT_STAT_CHASE_MOVE); }
|
||||
static void _addUnitStateMove(T &u) { u.AddUnitState(UNIT_STAT_CHASE_MOVE); }
|
||||
static void _clearUnitStateMove(T &u) { u.ClearUnitState(UNIT_STATE_CHASE_MOVE); }
|
||||
static void _addUnitStateMove(T &u) { u.AddUnitState(UNIT_STATE_CHASE_MOVE); }
|
||||
bool EnableWalking() const { return false;}
|
||||
bool _lostTarget(T &u) const { return u.getVictim() != this->GetTarget(); }
|
||||
void _reachTarget(T &);
|
||||
@@ -103,8 +103,8 @@ class FollowMovementGenerator : public TargetedMovementGeneratorMedium<T, Follow
|
||||
void Reset(T &);
|
||||
void MovementInform(T &);
|
||||
|
||||
static void _clearUnitStateMove(T &u) { u.ClearUnitState(UNIT_STAT_FOLLOW_MOVE); }
|
||||
static void _addUnitStateMove(T &u) { u.AddUnitState(UNIT_STAT_FOLLOW_MOVE); }
|
||||
static void _clearUnitStateMove(T &u) { u.ClearUnitState(UNIT_STATE_FOLLOW_MOVE); }
|
||||
static void _addUnitStateMove(T &u) { u.AddUnitState(UNIT_STATE_FOLLOW_MOVE); }
|
||||
bool EnableWalking() const;
|
||||
bool _lostTarget(T &) const { return false; }
|
||||
void _reachTarget(T &) {}
|
||||
|
||||
@@ -51,18 +51,18 @@ void WaypointMovementGenerator<Creature>::LoadPath(Creature &creature)
|
||||
void WaypointMovementGenerator<Creature>::Initialize(Creature &creature)
|
||||
{
|
||||
LoadPath(creature);
|
||||
creature.AddUnitState(UNIT_STAT_ROAMING|UNIT_STAT_ROAMING_MOVE);
|
||||
creature.AddUnitState(UNIT_STATE_ROAMING|UNIT_STATE_ROAMING_MOVE);
|
||||
}
|
||||
|
||||
void WaypointMovementGenerator<Creature>::Finalize(Creature &creature)
|
||||
{
|
||||
creature.ClearUnitState(UNIT_STAT_ROAMING|UNIT_STAT_ROAMING_MOVE);
|
||||
creature.ClearUnitState(UNIT_STATE_ROAMING|UNIT_STATE_ROAMING_MOVE);
|
||||
creature.SetWalk(false);
|
||||
}
|
||||
|
||||
void WaypointMovementGenerator<Creature>::Reset(Creature &creature)
|
||||
{
|
||||
creature.AddUnitState(UNIT_STAT_ROAMING|UNIT_STAT_ROAMING_MOVE);
|
||||
creature.AddUnitState(UNIT_STATE_ROAMING|UNIT_STATE_ROAMING_MOVE);
|
||||
StartMoveNow(creature);
|
||||
}
|
||||
|
||||
@@ -73,7 +73,7 @@ void WaypointMovementGenerator<Creature>::OnArrived(Creature& creature)
|
||||
if (m_isArrivalDone)
|
||||
return;
|
||||
|
||||
creature.ClearUnitState(UNIT_STAT_ROAMING_MOVE);
|
||||
creature.ClearUnitState(UNIT_STATE_ROAMING_MOVE);
|
||||
m_isArrivalDone = true;
|
||||
|
||||
if (i_path->at(i_currentNode)->event_id && urand(0, 99) < i_path->at(i_currentNode)->event_chance)
|
||||
@@ -111,7 +111,7 @@ bool WaypointMovementGenerator<Creature>::StartMove(Creature &creature)
|
||||
|
||||
m_isArrivalDone = false;
|
||||
|
||||
creature.AddUnitState(UNIT_STAT_ROAMING_MOVE);
|
||||
creature.AddUnitState(UNIT_STATE_ROAMING_MOVE);
|
||||
|
||||
Movement::MoveSplineInit init(creature);
|
||||
init.MoveTo(node->x, node->y, node->z);
|
||||
@@ -133,9 +133,9 @@ bool WaypointMovementGenerator<Creature>::Update(Creature &creature, const uint3
|
||||
{
|
||||
// Waypoint movement can be switched on/off
|
||||
// This is quite handy for escort quests and other stuff
|
||||
if (creature.HasUnitState(UNIT_STAT_NOT_MOVE))
|
||||
if (creature.HasUnitState(UNIT_STATE_NOT_MOVE))
|
||||
{
|
||||
creature.ClearUnitState(UNIT_STAT_ROAMING_MOVE);
|
||||
creature.ClearUnitState(UNIT_STATE_ROAMING_MOVE);
|
||||
return true;
|
||||
}
|
||||
// prevent a crash at empty waypoint path.
|
||||
@@ -204,7 +204,7 @@ void FlightPathMovementGenerator::Initialize(Player &player)
|
||||
void FlightPathMovementGenerator::Finalize(Player & player)
|
||||
{
|
||||
// remove flag to prevent send object build movement packets for flight state and crash (movement generator already not at top of stack)
|
||||
player.ClearUnitState(UNIT_STAT_IN_FLIGHT);
|
||||
player.ClearUnitState(UNIT_STATE_IN_FLIGHT);
|
||||
|
||||
player.Dismount();
|
||||
player.RemoveFlag(UNIT_FIELD_FLAGS,UNIT_FLAG_DISABLE_MOVE | UNIT_FLAG_TAXI_FLIGHT);
|
||||
@@ -227,7 +227,7 @@ void FlightPathMovementGenerator::Finalize(Player & player)
|
||||
void FlightPathMovementGenerator::Reset(Player & player)
|
||||
{
|
||||
player.getHostileRefManager().setOnlineOfflineState(false);
|
||||
player.AddUnitState(UNIT_STAT_IN_FLIGHT);
|
||||
player.AddUnitState(UNIT_STATE_IN_FLIGHT);
|
||||
player.SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_DISABLE_MOVE | UNIT_FLAG_TAXI_FLIGHT);
|
||||
|
||||
Movement::MoveSplineInit init(player);
|
||||
|
||||
Reference in New Issue
Block a user