[11721] Simplify walk/run movement mode selection code

This commit is contained in:
SilverIce 2011-07-08 19:26:40 +03:00
parent 9d566398ad
commit fc0eb7e9fa
10 changed files with 10 additions and 54 deletions

View file

@ -80,6 +80,7 @@ class MANGOS_DLL_SPEC ChaseMovementGenerator : public TargetedMovementGeneratorM
static void _clearUnitStateMove(T &u) { u.clearUnitState(UNIT_STAT_CHASE_MOVE); }
static void _addUnitStateMove(T &u) { u.addUnitState(UNIT_STAT_CHASE_MOVE); }
bool EnableWalking() const { return false;}
bool _lostTarget(T &u) const { return u.getVictim() != this->GetTarget(); }
void _reachTarget(T &);
};
@ -103,10 +104,10 @@ class MANGOS_DLL_SPEC FollowMovementGenerator : public TargetedMovementGenerator
static void _clearUnitStateMove(T &u) { u.clearUnitState(UNIT_STAT_FOLLOW_MOVE); }
static void _addUnitStateMove(T &u) { u.addUnitState(UNIT_STAT_FOLLOW_MOVE); }
bool EnableWalking() const;
bool _lostTarget(T &) const { return false; }
void _reachTarget(T &) {}
private:
void _updateWalkMode(T &u);
void _updateSpeed(T &u);
};