Reinstate cached preferred mounts (#1058)

This commit is contained in:
SaW
2025-03-05 17:24:54 +01:00
committed by GitHub
parent a4fe45afbb
commit b9747fdd69
2 changed files with 92 additions and 35 deletions

View File

@@ -6,6 +6,9 @@
#ifndef _PLAYERBOT_CHECKMOUNTSTATEACTION_H
#define _PLAYERBOT_CHECKMOUNTSTATEACTION_H
#include <unordered_map>
#include <vector>
#include "UseItemAction.h"
const uint16 SPELL_TRAVEL_FORM = 783;
@@ -21,6 +24,12 @@ struct MountData
int32 maxSpeed = 59;
};
struct PreferredMountCache
{
std::vector<uint32> groundMounts;
std::vector<uint32> flightMounts;
};
class PlayerbotAI;
class CheckMountStateAction : public UseItemAction
@@ -37,6 +46,8 @@ private:
Player* master;
ShapeshiftForm masterInShapeshiftForm;
ShapeshiftForm botInShapeshiftForm;
static std::unordered_map<uint32, PreferredMountCache> mountCache;
static bool preferredMountTableExists;
float CalculateDismountDistance() const;
float CalculateMountDistance() const;
void Dismount();