Refactor of the CheckMountStateAction class (#919)

* Update CheckMountStateAction.cpp

The refactoring focused on improving readability, reducing redundancy, and optimizing performance where possible.

* Update CheckMountStateAction.h

* Update CheckMountStateAction.cpp

* Update CheckMountStateAction.cpp

* Update CheckMountStateAction.cpp

* Update CheckMountStateAction.h

* Fix lowest level mount from config

* Properly fix

* Reduced masterInShapeshiftForm lookups to 1

Reduced masterInShapeshiftForm lookups to 1

* Fix for missing useFastGroundMountAtMinLevel

* Final commit: Ensure max 99 speed in BG
This commit is contained in:
SaW
2025-01-28 09:08:21 +01:00
committed by GitHub
parent a8d8f37019
commit f52f999c09
2 changed files with 241 additions and 200 deletions

View File

@@ -19,6 +19,21 @@ public:
bool isUseful() override;
bool isPossible() override { return true; }
bool Mount();
private:
ShapeshiftForm masterInShapeshiftForm;
float CalculateDismountDistance() const;
float CalculateMountDistance() const;
void Dismount();
bool ShouldFollowMasterMountState(Player* master, bool noAttackers, bool shouldMount) const;
bool ShouldDismountForMaster(Player* master) const;
int32 CalculateMasterMountSpeed(Player* master) const;
bool CheckForSwiftMount() const;
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;
};
#endif