MSA Improvement Part 2 (#66) (#933)

Reduce iterations.
This commit is contained in:
SaW
2025-02-01 20:23:25 +01:00
committed by GitHub
parent 6719d61ae0
commit e07a9e194a
2 changed files with 137 additions and 137 deletions

View File

@@ -8,6 +8,15 @@
#include "UseItemAction.h"
struct MountData
{
bool swiftMount = false;
// Outer map: index (0 for ground, 1 for flight), inner map: effect speed -> vector of spell IDs.
std::map<uint32, std::map<int32, std::vector<uint32>>> allSpells;
// Default mount speed.
int32 maxSpeed = 59;
};
class PlayerbotAI;
class CheckMountStateAction : public UseItemAction
@@ -32,8 +41,7 @@ private:
std::map<uint32, std::map<int32, std::vector<uint32>>> GetAllMountSpells() const;
bool TryPreferredMount(Player* master) const;
uint32 GetMountType(Player* master) const;
void FilterMountsBySpeed(std::map<int32, std::vector<uint32>>& spells, int32 masterSpeed) const;
bool TryRandomMount(const std::map<int32, std::vector<uint32>>& spells) const;
bool TryRandomMountFiltered(const std::map<int32, std::vector<uint32>>& spells, int32 masterSpeed) const;
};
#endif