mirror of
https://github.com/araxiaonline/AzerothCore-wotlk-with-NPCBots-2025.git
synced 2026-06-13 03:22:24 -04:00
NPCBots: Fix ranges sorting for bot containers 1
(cherry picked from TC commit d08321a758995cdc66be2eb63124b51e9f9a4739)
This commit is contained in:
@@ -451,12 +451,13 @@ private:
|
||||
|
||||
struct BotInfo
|
||||
{
|
||||
explicit BotInfo(uint32 Id, std::string&& Name, uint8 Race) : id(Id), name(std::move(Name)), race(Race) {}
|
||||
BotInfo(uint32 Id, std::string&& Name, uint8 Race) : id(Id), name(std::move(Name)), race(Race) {}
|
||||
uint32 id;
|
||||
std::string name;
|
||||
uint8 race;
|
||||
|
||||
inline constexpr std::strong_ordering operator<=>(BotInfo const& other) const noexcept = default;
|
||||
inline constexpr bool operator==(BotInfo const& other) const noexcept { return id == other.id; }
|
||||
inline constexpr std::strong_ordering operator<=>(BotInfo const& other) const noexcept { return id <=> other.id; }
|
||||
};
|
||||
|
||||
static char const* get_race_name(uint8 race)
|
||||
|
||||
@@ -76,9 +76,10 @@ public:
|
||||
WanderNode* wp;
|
||||
uint32 weight;
|
||||
|
||||
inline uint32 Id() const { return wp ? wp->GetWPId() : 0; }
|
||||
inline constexpr uint32 Id() const noexcept { return wp ? wp->GetWPId() : 0; }
|
||||
|
||||
inline constexpr std::strong_ordering operator<=>(WanderNodeLink const& other) const noexcept = default;
|
||||
inline constexpr bool operator==(WanderNodeLink const& other) const noexcept { return Id() == other.Id(); }
|
||||
inline constexpr std::strong_ordering operator<=>(WanderNodeLink const& other) const noexcept { return Id() <=> other.Id(); }
|
||||
|
||||
struct WeightExtractor {
|
||||
inline constexpr uint32 operator()(WanderNodeLink const& wpl) const noexcept { return wpl.weight; }
|
||||
|
||||
Reference in New Issue
Block a user