Fix for bot out-of-combat movement animation glitches

This commit is contained in:
Uleat 2019-01-27 08:09:54 -05:00
parent 3c0bd2bf5d
commit 5b371ad054
3 changed files with 27 additions and 2 deletions

View File

@ -339,6 +339,8 @@ public:
bool IsStanding();
virtual int GetWalkspeed() const { return (int)((float)_GetWalkSpeed() * 1.785714f); } // 1.25 / 0.7 = 1.7857142857142857142857142857143
virtual int GetRunspeed() const { return (int)((float)_GetRunSpeed() * 1.785714f); }
virtual void WalkTo(float x, float y, float z);
virtual void RunTo(float x, float y, float z);
bool UseDiscipline(uint32 spell_id, uint32 target);
uint8 GetNumberNeedingHealedInGroup(uint8 hpr, bool includePets);
bool GetNeedsCured(Mob *tar);

View File

@ -998,8 +998,8 @@ public:
inline bool CheckAggro(Mob* other) {return hate_list.IsEntOnHateList(other);}
float CalculateHeadingToTarget(float in_x, float in_y) { return HeadingAngleToMob(in_x, in_y); }
void WalkTo(float x, float y, float z);
void RunTo(float x, float y, float z);
virtual void WalkTo(float x, float y, float z);
virtual void RunTo(float x, float y, float z);
void NavigateTo(float x, float y, float z);
void RotateTo(float new_heading);
void RotateToWalking(float new_heading);

View File

@ -1063,3 +1063,26 @@ void NPC::RestoreGuardSpotCharm()
{
m_GuardPoint = m_GuardPointSaved;
}
/******************
* Bot-specific overloads to make them play nice with the new movement system
*/
#ifdef BOTS
#include "bot.h"
void Bot::WalkTo(float x, float y, float z)
{
if (IsSitting())
Stand();
Mob::WalkTo(x, y, z);
}
void Bot::RunTo(float x, float y, float z)
{
if (IsSitting())
Stand();
Mob::RunTo(x, y, z);
}
#endif