Fix issue with heading being incorrectly handled

So we've been doing heading wrong all these years. You will need to run
a script to fix your quests and required SQL to fix DB.

This fixes a ton of random issues with headings and as gives us a better
resolution on headings :P
This commit is contained in:
Michael Cook (mackal)
2018-02-15 18:20:16 -05:00
parent 91d3851d76
commit a32dedeb48
17 changed files with 169 additions and 162 deletions
+3 -2
View File
@@ -177,7 +177,8 @@ public:
inline bool InFrontMob(Mob *other = 0, float ourx = 0.0f, float oury = 0.0f) const
{ return (!other || other == this) ? true : MobAngle(other, ourx, oury) < 56.0f; }
bool IsFacingMob(Mob *other); // kind of does the same as InFrontMob, but derived from client
float HeadingAngleToMob(Mob *other); // to keep consistent with client generated messages
float HeadingAngleToMob(Mob *other) { return HeadingAngleToMob(other->GetX(), other->GetY()); }
float HeadingAngleToMob(float other_x, float other_y); // to keep consistent with client generated messages
virtual void RangedAttack(Mob* other) { }
virtual void ThrowingAttack(Mob* other) { }
// 13 = Primary (default), 14 = secondary
@@ -970,7 +971,7 @@ public:
inline bool IsBlind() { return spellbonuses.IsBlind; }
inline bool CheckAggro(Mob* other) {return hate_list.IsEntOnHateList(other);}
float CalculateHeadingToTarget(float in_x, float in_y);
float CalculateHeadingToTarget(float in_x, float in_y) {return HeadingAngleToMob(in_x, in_y); }
bool CalculateNewPosition(float x, float y, float z, int speed, bool checkZ = false, bool calcHeading = true);
virtual bool CalculateNewPosition2(float x, float y, float z, int speed, bool checkZ = true, bool calcHeading = true);
float CalculateDistance(float x, float y, float z);