From 5b371ad054ec4b053e7361bbdbe7ca6c59acac79 Mon Sep 17 00:00:00 2001 From: Uleat Date: Sun, 27 Jan 2019 08:09:54 -0500 Subject: [PATCH] Fix for bot out-of-combat movement animation glitches --- zone/bot.h | 2 ++ zone/mob.h | 4 ++-- zone/waypoints.cpp | 23 +++++++++++++++++++++++ 3 files changed, 27 insertions(+), 2 deletions(-) diff --git a/zone/bot.h b/zone/bot.h index c4f47cd66..7b8bb59c5 100644 --- a/zone/bot.h +++ b/zone/bot.h @@ -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); diff --git a/zone/mob.h b/zone/mob.h index 807007a68..423dbb63e 100644 --- a/zone/mob.h +++ b/zone/mob.h @@ -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); diff --git a/zone/waypoints.cpp b/zone/waypoints.cpp index 60a85449e..cf79aae08 100644 --- a/zone/waypoints.cpp +++ b/zone/waypoints.cpp @@ -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