[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

@ -1467,6 +1467,8 @@ class MANGOS_DLL_SPEC Unit : public WorldObject
// recommend use MonsterMove/MonsterMoveWithSpeed for most case that correctly work with movegens
// if used additional args in ... part then floats must explicitly casted to double
void SendHeartBeat();
bool IsLevitating() const { return m_movementInfo.HasMovementFlag(MOVEFLAG_LEVITATING);}
bool IsWalking() const { return m_movementInfo.HasMovementFlag(MOVEFLAG_WALK_MODE);}
void SetInFront(Unit const* target);
void SetFacingTo(float ori);
@ -1886,7 +1888,6 @@ class MANGOS_DLL_SPEC Unit : public WorldObject
void CalculateAbsorbResistBlock(Unit *pCaster, SpellNonMeleeDamage *damageInfo, SpellEntry const* spellProto, WeaponAttackType attType = BASE_ATTACK);
void CalculateHealAbsorb(uint32 heal, uint32 *absorb);
void UpdateWalkMode(Unit* source, bool self = true);
void UpdateSpeed(UnitMoveType mtype, bool forced, float ratio = 1.0f);
float GetSpeed( UnitMoveType mtype ) const;
float GetSpeedRate( UnitMoveType mtype ) const { return m_speed_rate[mtype]; }