mirror of
https://github.com/mod-playerbots/azerothcore-wotlk.git
synced 2026-02-05 20:13:48 +00:00
refactor(Core): apply clang-tidy modernize-* (#9975)
Co-authored-by: Kitzunu <24550914+Kitzunu@users.noreply.github.com>
This commit is contained in:
@@ -69,7 +69,7 @@ public:
|
||||
void ResetGhostTime() { m_time = time(nullptr); }
|
||||
[[nodiscard]] CorpseType GetType() const { return m_type; }
|
||||
|
||||
CellCoord const& GetCellCoord() const { return _cellCoord; }
|
||||
[[nodiscard]] CellCoord const& GetCellCoord() const { return _cellCoord; }
|
||||
void SetCellCoord(CellCoord const& cellCoord) { _cellCoord = cellCoord; }
|
||||
|
||||
Loot loot; // remove insignia ONLY at BG
|
||||
|
||||
@@ -258,7 +258,7 @@ public:
|
||||
bool HasSearchedAssistance() { return m_AlreadySearchedAssistance; }
|
||||
bool CanAssistTo(const Unit* u, const Unit* enemy, bool checkfaction = true) const;
|
||||
bool _IsTargetAcceptable(const Unit* target) const;
|
||||
bool CanIgnoreFeignDeath() const { return (GetCreatureTemplate()->flags_extra & CREATURE_FLAG_EXTRA_IGNORE_FEIGN_DEATH) != 0; }
|
||||
[[nodiscard]] bool CanIgnoreFeignDeath() const { return (GetCreatureTemplate()->flags_extra & CREATURE_FLAG_EXTRA_IGNORE_FEIGN_DEATH) != 0; }
|
||||
|
||||
// pussywizard: updated at faction change, disable move in line of sight if actual faction is not hostile to anyone
|
||||
void UpdateMoveInLineOfSightState();
|
||||
@@ -360,7 +360,7 @@ public:
|
||||
void SetTarget(ObjectGuid guid = ObjectGuid::Empty) override;
|
||||
void FocusTarget(Spell const* focusSpell, WorldObject const* target);
|
||||
void ReleaseFocus(Spell const* focusSpell);
|
||||
bool IsMovementPreventedByCasting() const override;
|
||||
[[nodiscard]] bool IsMovementPreventedByCasting() const override;
|
||||
|
||||
// Part of Evade mechanics
|
||||
[[nodiscard]] time_t GetLastDamagedTime() const;
|
||||
@@ -374,7 +374,7 @@ public:
|
||||
uint32 m_moveCircleMovementTime = MOVE_CIRCLE_CHECK_INTERVAL;
|
||||
uint32 m_moveBackwardsMovementTime = MOVE_BACKWARDS_CHECK_INTERVAL;
|
||||
|
||||
bool HasSwimmingFlagOutOfCombat() const
|
||||
[[nodiscard]] bool HasSwimmingFlagOutOfCombat() const
|
||||
{
|
||||
return !_isMissingSwimmingFlagOutOfCombat;
|
||||
}
|
||||
|
||||
@@ -358,8 +358,8 @@ typedef std::unordered_map<uint32, EquipmentInfoContainerInternal> EquipmentInfo
|
||||
// from `creature` table
|
||||
struct CreatureData
|
||||
{
|
||||
CreatureData() { }
|
||||
uint32 id1{0}; // entry in creature_template
|
||||
CreatureData() = default;
|
||||
uint32 id1{0}; // entry in creature_template
|
||||
uint32 id2{0}; // entry in creature_template
|
||||
uint32 id3{0}; // entry in creature_template
|
||||
uint16 mapid{0};
|
||||
@@ -519,7 +519,7 @@ typedef std::unordered_map<uint32 /*spellid*/, TrainerSpell> TrainerSpellMap;
|
||||
|
||||
struct TrainerSpellData
|
||||
{
|
||||
TrainerSpellData() {}
|
||||
TrainerSpellData() = default;
|
||||
~TrainerSpellData() { spellList.clear(); }
|
||||
|
||||
TrainerSpellMap spellList;
|
||||
@@ -530,11 +530,11 @@ struct TrainerSpellData
|
||||
|
||||
struct CreatureSpellCooldown
|
||||
{
|
||||
CreatureSpellCooldown() : category(0), end(0) { }
|
||||
CreatureSpellCooldown() = default;
|
||||
CreatureSpellCooldown(uint16 categoryId, uint32 endTime) : category(categoryId), end(endTime) { }
|
||||
|
||||
uint16 category;
|
||||
uint32 end;
|
||||
uint16 category{0};
|
||||
uint32 end{0};
|
||||
};
|
||||
|
||||
typedef std::map<uint32, CreatureSpellCooldown> CreatureSpellCooldowns;
|
||||
|
||||
@@ -720,7 +720,7 @@ enum GOState
|
||||
// from `gameobject`
|
||||
struct GameObjectData
|
||||
{
|
||||
explicit GameObjectData() { }
|
||||
explicit GameObjectData() = default;
|
||||
uint32 id{0}; // entry in gamobject_template
|
||||
uint16 mapid{0};
|
||||
uint32 phaseMask{0};
|
||||
|
||||
@@ -101,7 +101,7 @@ public:
|
||||
[[nodiscard]] uint32 GetEntry() const { return GetUInt32Value(OBJECT_FIELD_ENTRY); }
|
||||
void SetEntry(uint32 entry) { SetUInt32Value(OBJECT_FIELD_ENTRY, entry); }
|
||||
|
||||
float GetObjectScale() const { return GetFloatValue(OBJECT_FIELD_SCALE_X); }
|
||||
[[nodiscard]] float GetObjectScale() const { return GetFloatValue(OBJECT_FIELD_SCALE_X); }
|
||||
virtual void SetObjectScale(float scale) { SetFloatValue(OBJECT_FIELD_SCALE_X, scale); }
|
||||
|
||||
[[nodiscard]] TypeID GetTypeId() const { return m_objectTypeId; }
|
||||
@@ -375,26 +375,26 @@ struct Position
|
||||
return dx*dx + dy*dy;
|
||||
}
|
||||
|
||||
float GetExactDist2dSq(Position const& pos) const { return GetExactDist2dSq(pos.m_positionX, pos.m_positionY); }
|
||||
[[nodiscard]] float GetExactDist2dSq(Position const& pos) const { return GetExactDist2dSq(pos.m_positionX, pos.m_positionY); }
|
||||
float GetExactDist2dSq(Position const* pos) const { return GetExactDist2dSq(*pos); }
|
||||
float GetExactDist2d(const float x, const float y) const { return std::sqrt(GetExactDist2dSq(x, y)); }
|
||||
float GetExactDist2d(Position const& pos) const { return GetExactDist2d(pos.m_positionX, pos.m_positionY); }
|
||||
[[nodiscard]] float GetExactDist2d(const float x, const float y) const { return std::sqrt(GetExactDist2dSq(x, y)); }
|
||||
[[nodiscard]] float GetExactDist2d(Position const& pos) const { return GetExactDist2d(pos.m_positionX, pos.m_positionY); }
|
||||
float GetExactDist2d(Position const* pos) const { return GetExactDist2d(*pos); }
|
||||
|
||||
float GetExactDistSq(float x, float y, float z) const
|
||||
[[nodiscard]] float GetExactDistSq(float x, float y, float z) const
|
||||
{
|
||||
float dz = z - m_positionZ;
|
||||
return GetExactDist2dSq(x, y) + dz*dz;
|
||||
}
|
||||
|
||||
float GetExactDistSq(Position const& pos) const { return GetExactDistSq(pos.m_positionX, pos.m_positionY, pos.m_positionZ); }
|
||||
[[nodiscard]] float GetExactDistSq(Position const& pos) const { return GetExactDistSq(pos.m_positionX, pos.m_positionY, pos.m_positionZ); }
|
||||
float GetExactDistSq(Position const* pos) const { return GetExactDistSq(*pos); }
|
||||
float GetExactDist(float x, float y, float z) const { return std::sqrt(GetExactDistSq(x, y, z)); }
|
||||
float GetExactDist(Position const& pos) const { return GetExactDist(pos.m_positionX, pos.m_positionY, pos.m_positionZ); }
|
||||
[[nodiscard]] float GetExactDist(float x, float y, float z) const { return std::sqrt(GetExactDistSq(x, y, z)); }
|
||||
[[nodiscard]] float GetExactDist(Position const& pos) const { return GetExactDist(pos.m_positionX, pos.m_positionY, pos.m_positionZ); }
|
||||
float GetExactDist(Position const* pos) const { return GetExactDist(*pos); }
|
||||
|
||||
void GetPositionOffsetTo(const Position& endPos, Position& retOffset) const;
|
||||
Position GetPositionWithOffset(Position const& offset) const;
|
||||
[[nodiscard]] Position GetPositionWithOffset(Position const& offset) const;
|
||||
|
||||
float GetAngle(const Position* pos) const;
|
||||
[[nodiscard]] float GetAngle(float x, float y) const;
|
||||
@@ -413,7 +413,7 @@ struct Position
|
||||
return GetAngle(pos) - m_orientation;
|
||||
}
|
||||
[[nodiscard]] float GetRelativeAngle(float x, float y) const { return GetAngle(x, y) - m_orientation; }
|
||||
float ToAbsoluteAngle(float relAngle) const { return NormalizeOrientation(relAngle + m_orientation); }
|
||||
[[nodiscard]] float ToAbsoluteAngle(float relAngle) const { return NormalizeOrientation(relAngle + m_orientation); }
|
||||
|
||||
void GetSinCos(float x, float y, float& vsin, float& vcos) const;
|
||||
|
||||
@@ -655,7 +655,7 @@ class MovableMapObject
|
||||
template<class T> friend class RandomMovementGenerator;
|
||||
|
||||
protected:
|
||||
MovableMapObject() {}
|
||||
MovableMapObject() = default;
|
||||
|
||||
private:
|
||||
[[nodiscard]] Cell const& GetCurrentCell() const { return _currentCell; }
|
||||
@@ -702,7 +702,7 @@ public:
|
||||
void UpdateAllowedPositionZ(float x, float y, float& z, float* groundZ = nullptr) const;
|
||||
|
||||
void GetRandomPoint(const Position& srcPos, float distance, float& rand_x, float& rand_y, float& rand_z) const;
|
||||
Position GetRandomPoint(const Position& srcPos, float distance) const;
|
||||
[[nodiscard]] Position GetRandomPoint(const Position& srcPos, float distance) const;
|
||||
|
||||
[[nodiscard]] uint32 GetInstanceId() const { return m_InstanceId; }
|
||||
|
||||
@@ -715,9 +715,9 @@ public:
|
||||
[[nodiscard]] uint32 GetAreaId() const;
|
||||
void GetZoneAndAreaId(uint32& zoneid, uint32& areaid) const;
|
||||
[[nodiscard]] bool IsOutdoors() const;
|
||||
LiquidData const& GetLiquidData() const;
|
||||
[[nodiscard]] LiquidData const& GetLiquidData() const;
|
||||
|
||||
InstanceScript* GetInstanceScript() const;
|
||||
[[nodiscard]] InstanceScript* GetInstanceScript() const;
|
||||
|
||||
[[nodiscard]] std::string const& GetName() const { return m_name; }
|
||||
void SetName(std::string const& newname) { m_name = newname; }
|
||||
|
||||
@@ -129,7 +129,7 @@ class ObjectGuid
|
||||
template<HighGuid type>
|
||||
static typename std::enable_if<ObjectGuidTraits<type>::MapSpecific, ObjectGuid>::type Create(uint32 entry, LowType counter) { return MapSpecific(type, entry, counter); }
|
||||
|
||||
ObjectGuid() : _guid(0) { }
|
||||
ObjectGuid() = default;
|
||||
explicit ObjectGuid(uint64 guid) : _guid(guid) { }
|
||||
ObjectGuid(HighGuid hi, uint32 entry, LowType counter) : _guid(counter ? uint64(counter) | (uint64(entry) << 24) | (uint64(hi) << 48) : 0) { }
|
||||
ObjectGuid(HighGuid hi, LowType counter) : _guid(counter ? uint64(counter) | (uint64(hi) << 48) : 0) { }
|
||||
@@ -139,12 +139,12 @@ class ObjectGuid
|
||||
void Set(uint64 guid) { _guid = guid; }
|
||||
void Clear() { _guid = 0; }
|
||||
|
||||
PackedGuid WriteAsPacked() const;
|
||||
[[nodiscard]] PackedGuid WriteAsPacked() const;
|
||||
|
||||
uint64 GetRawValue() const { return _guid; }
|
||||
HighGuid GetHigh() const { return HighGuid((_guid >> 48) & 0x0000FFFF); }
|
||||
uint32 GetEntry() const { return HasEntry() ? uint32((_guid >> 24) & UI64LIT(0x0000000000FFFFFF)) : 0; }
|
||||
LowType GetCounter() const
|
||||
[[nodiscard]] uint64 GetRawValue() const { return _guid; }
|
||||
[[nodiscard]] HighGuid GetHigh() const { return HighGuid((_guid >> 48) & 0x0000FFFF); }
|
||||
[[nodiscard]] uint32 GetEntry() const { return HasEntry() ? uint32((_guid >> 24) & UI64LIT(0x0000000000FFFFFF)) : 0; }
|
||||
[[nodiscard]] LowType GetCounter() const
|
||||
{
|
||||
return HasEntry()
|
||||
? LowType(_guid & UI64LIT(0x0000000000FFFFFF))
|
||||
@@ -158,26 +158,26 @@ class ObjectGuid
|
||||
: LowType(0xFFFFFFFF);
|
||||
}
|
||||
|
||||
ObjectGuid::LowType GetMaxCounter() const { return GetMaxCounter(GetHigh()); }
|
||||
[[nodiscard]] ObjectGuid::LowType GetMaxCounter() const { return GetMaxCounter(GetHigh()); }
|
||||
|
||||
bool IsEmpty() const { return _guid == 0; }
|
||||
bool IsCreature() const { return GetHigh() == HighGuid::Unit; }
|
||||
bool IsPet() const { return GetHigh() == HighGuid::Pet; }
|
||||
bool IsVehicle() const { return GetHigh() == HighGuid::Vehicle; }
|
||||
bool IsCreatureOrPet() const { return IsCreature() || IsPet(); }
|
||||
bool IsCreatureOrVehicle() const { return IsCreature() || IsVehicle(); }
|
||||
bool IsAnyTypeCreature() const { return IsCreature() || IsPet() || IsVehicle(); }
|
||||
bool IsPlayer() const { return !IsEmpty() && GetHigh() == HighGuid::Player; }
|
||||
bool IsUnit() const { return IsAnyTypeCreature() || IsPlayer(); }
|
||||
bool IsItem() const { return GetHigh() == HighGuid::Item; }
|
||||
bool IsGameObject() const { return GetHigh() == HighGuid::GameObject; }
|
||||
bool IsDynamicObject() const { return GetHigh() == HighGuid::DynamicObject; }
|
||||
bool IsCorpse() const { return GetHigh() == HighGuid::Corpse; }
|
||||
bool IsTransport() const { return GetHigh() == HighGuid::Transport; }
|
||||
bool IsMOTransport() const { return GetHigh() == HighGuid::Mo_Transport; }
|
||||
bool IsAnyTypeGameObject() const { return IsGameObject() || IsTransport() || IsMOTransport(); }
|
||||
bool IsInstance() const { return GetHigh() == HighGuid::Instance; }
|
||||
bool IsGroup() const { return GetHigh() == HighGuid::Group; }
|
||||
[[nodiscard]] bool IsEmpty() const { return _guid == 0; }
|
||||
[[nodiscard]] bool IsCreature() const { return GetHigh() == HighGuid::Unit; }
|
||||
[[nodiscard]] bool IsPet() const { return GetHigh() == HighGuid::Pet; }
|
||||
[[nodiscard]] bool IsVehicle() const { return GetHigh() == HighGuid::Vehicle; }
|
||||
[[nodiscard]] bool IsCreatureOrPet() const { return IsCreature() || IsPet(); }
|
||||
[[nodiscard]] bool IsCreatureOrVehicle() const { return IsCreature() || IsVehicle(); }
|
||||
[[nodiscard]] bool IsAnyTypeCreature() const { return IsCreature() || IsPet() || IsVehicle(); }
|
||||
[[nodiscard]] bool IsPlayer() const { return !IsEmpty() && GetHigh() == HighGuid::Player; }
|
||||
[[nodiscard]] bool IsUnit() const { return IsAnyTypeCreature() || IsPlayer(); }
|
||||
[[nodiscard]] bool IsItem() const { return GetHigh() == HighGuid::Item; }
|
||||
[[nodiscard]] bool IsGameObject() const { return GetHigh() == HighGuid::GameObject; }
|
||||
[[nodiscard]] bool IsDynamicObject() const { return GetHigh() == HighGuid::DynamicObject; }
|
||||
[[nodiscard]] bool IsCorpse() const { return GetHigh() == HighGuid::Corpse; }
|
||||
[[nodiscard]] bool IsTransport() const { return GetHigh() == HighGuid::Transport; }
|
||||
[[nodiscard]] bool IsMOTransport() const { return GetHigh() == HighGuid::Mo_Transport; }
|
||||
[[nodiscard]] bool IsAnyTypeGameObject() const { return IsGameObject() || IsTransport() || IsMOTransport(); }
|
||||
[[nodiscard]] bool IsInstance() const { return GetHigh() == HighGuid::Instance; }
|
||||
[[nodiscard]] bool IsGroup() const { return GetHigh() == HighGuid::Group; }
|
||||
|
||||
static TypeID GetTypeId(HighGuid high)
|
||||
{
|
||||
@@ -200,7 +200,7 @@ class ObjectGuid
|
||||
}
|
||||
}
|
||||
|
||||
TypeID GetTypeId() const { return GetTypeId(GetHigh()); }
|
||||
[[nodiscard]] TypeID GetTypeId() const { return GetTypeId(GetHigh()); }
|
||||
|
||||
operator bool() const { return !IsEmpty(); }
|
||||
bool operator!() const { return !(bool(*this)); }
|
||||
@@ -210,8 +210,8 @@ class ObjectGuid
|
||||
bool operator<= (ObjectGuid const& guid) const { return GetRawValue() <= guid.GetRawValue(); }
|
||||
|
||||
static char const* GetTypeName(HighGuid high);
|
||||
char const* GetTypeName() const { return !IsEmpty() ? GetTypeName(GetHigh()) : "None"; }
|
||||
std::string ToString() const;
|
||||
[[nodiscard]] char const* GetTypeName() const { return !IsEmpty() ? GetTypeName(GetHigh()) : "None"; }
|
||||
[[nodiscard]] std::string ToString() const;
|
||||
|
||||
private:
|
||||
static bool HasEntry(HighGuid high)
|
||||
@@ -236,7 +236,7 @@ class ObjectGuid
|
||||
}
|
||||
}
|
||||
|
||||
bool HasEntry() const { return HasEntry(GetHigh()); }
|
||||
[[nodiscard]] bool HasEntry() const { return HasEntry(GetHigh()); }
|
||||
|
||||
static ObjectGuid Global(HighGuid type, LowType counter);
|
||||
static ObjectGuid MapSpecific(HighGuid type, uint32 entry, LowType counter);
|
||||
@@ -248,7 +248,7 @@ class ObjectGuid
|
||||
// used to catch wrong type assignment
|
||||
operator int64() const = delete;
|
||||
|
||||
uint64 _guid;
|
||||
uint64 _guid{0};
|
||||
};
|
||||
|
||||
// Some Shared defines
|
||||
@@ -273,7 +273,7 @@ class PackedGuid
|
||||
void Set(uint64 guid) { _packedGuid.wpos(0); _packedGuid.appendPackGUID(guid); }
|
||||
void Set(ObjectGuid guid) { _packedGuid.wpos(0); _packedGuid.appendPackGUID(guid.GetRawValue()); }
|
||||
|
||||
std::size_t size() const { return _packedGuid.size(); }
|
||||
[[nodiscard]] std::size_t size() const { return _packedGuid.size(); }
|
||||
|
||||
private:
|
||||
ByteBuffer _packedGuid;
|
||||
@@ -286,8 +286,8 @@ public:
|
||||
|
||||
virtual void Set(ObjectGuid::LowType val) { _nextGuid = val; }
|
||||
virtual ObjectGuid::LowType Generate() = 0;
|
||||
ObjectGuid::LowType GetNextAfterMaxUsed() const { return _nextGuid; }
|
||||
virtual ~ObjectGuidGeneratorBase() { }
|
||||
[[nodiscard]] ObjectGuid::LowType GetNextAfterMaxUsed() const { return _nextGuid; }
|
||||
virtual ~ObjectGuidGeneratorBase() = default;
|
||||
|
||||
protected:
|
||||
static void HandleCounterOverflow(HighGuid high);
|
||||
|
||||
@@ -33,9 +33,9 @@ public:
|
||||
CLIENT_UPDATE_MASK_BITS = sizeof(ClientUpdateMaskType) * 8,
|
||||
};
|
||||
|
||||
UpdateMask() { }
|
||||
UpdateMask() = default;
|
||||
|
||||
UpdateMask(UpdateMask const& right) : _bits(nullptr)
|
||||
UpdateMask(UpdateMask const& right)
|
||||
{
|
||||
SetCount(right.GetCount());
|
||||
memcpy(_bits, right._bits, sizeof(uint8) * _blockCount * 32);
|
||||
|
||||
@@ -221,7 +221,7 @@ public:
|
||||
uint32 MaxStabledPets = 0;
|
||||
std::vector<PetInfo> UnslottedPets; // PET_SAVE_NOT_IN_SLOT
|
||||
|
||||
PetInfo const* GetUnslottedHunterPet() const
|
||||
[[nodiscard]] PetInfo const* GetUnslottedHunterPet() const
|
||||
{
|
||||
return UnslottedPets.size() == 1 && UnslottedPets[0].Type == HUNTER_PET ? &UnslottedPets[0] : nullptr;
|
||||
}
|
||||
|
||||
@@ -248,7 +248,7 @@ enum ReputationSource
|
||||
|
||||
struct ActionButton
|
||||
{
|
||||
ActionButton() {}
|
||||
ActionButton() = default;
|
||||
|
||||
uint32 packedData{0};
|
||||
ActionButtonUpdateState uState{ACTIONBUTTON_NEW};
|
||||
@@ -284,14 +284,14 @@ typedef std::list<PlayerCreateInfoItem> PlayerCreateInfoItems;
|
||||
|
||||
struct PlayerClassLevelInfo
|
||||
{
|
||||
PlayerClassLevelInfo() {}
|
||||
PlayerClassLevelInfo() = default;
|
||||
uint16 basehealth{0};
|
||||
uint16 basemana{0};
|
||||
};
|
||||
|
||||
struct PlayerClassInfo
|
||||
{
|
||||
PlayerClassInfo() { }
|
||||
PlayerClassInfo() = default;
|
||||
|
||||
PlayerClassLevelInfo* levelInfo{nullptr}; //[level-1] 0..MaxPlayerLevel-1
|
||||
};
|
||||
@@ -307,7 +307,7 @@ typedef std::list<uint32> PlayerCreateInfoSpells;
|
||||
|
||||
struct PlayerCreateInfoAction
|
||||
{
|
||||
PlayerCreateInfoAction() {}
|
||||
PlayerCreateInfoAction() = default;
|
||||
PlayerCreateInfoAction(uint8 _button, uint32 _action, uint8 _type) : button(_button), type(_type), action(_action) {}
|
||||
|
||||
uint8 button{0};
|
||||
@@ -328,7 +328,7 @@ typedef std::list<PlayerCreateInfoSkill> PlayerCreateInfoSkills;
|
||||
struct PlayerInfo
|
||||
{
|
||||
// existence checked by displayId != 0
|
||||
PlayerInfo() { }
|
||||
PlayerInfo() = default;
|
||||
|
||||
uint32 mapId{0};
|
||||
uint32 areaId{0};
|
||||
@@ -349,7 +349,7 @@ struct PlayerInfo
|
||||
|
||||
struct PvPInfo
|
||||
{
|
||||
PvPInfo() {}
|
||||
PvPInfo() = default;
|
||||
|
||||
bool IsHostile{false};
|
||||
bool IsInHostileArea{false}; ///> Marks if player is in an area which forces PvP flag
|
||||
@@ -433,7 +433,7 @@ struct Runes
|
||||
|
||||
struct EnchantDuration
|
||||
{
|
||||
EnchantDuration() {};
|
||||
EnchantDuration() = default;;
|
||||
EnchantDuration(Item* _item, EnchantmentSlot _slot, uint32 _leftduration) : item(_item), slot(_slot),
|
||||
leftduration(_leftduration) { ASSERT(item); };
|
||||
|
||||
@@ -739,7 +739,7 @@ enum EquipmentSetUpdateState
|
||||
|
||||
struct EquipmentSet
|
||||
{
|
||||
EquipmentSet() { }
|
||||
EquipmentSet() = default;
|
||||
|
||||
uint64 Guid;
|
||||
std::string Name;
|
||||
@@ -1003,7 +1003,7 @@ class Player;
|
||||
// holder for Battleground data (pussywizard: not stored in db)
|
||||
struct BGData
|
||||
{
|
||||
BGData() {}
|
||||
BGData() = default;
|
||||
|
||||
uint32 bgInstanceID{0};
|
||||
BattlegroundTypeId bgTypeID{BATTLEGROUND_TYPE_NONE};
|
||||
@@ -1161,14 +1161,14 @@ public:
|
||||
[[nodiscard]] float GetRestBonus() const { return _restBonus; }
|
||||
void SetRestBonus(float rest_bonus_new);
|
||||
|
||||
bool HasRestFlag(RestFlag restFlag) const { return (_restFlagMask & restFlag) != 0; }
|
||||
[[nodiscard]] bool HasRestFlag(RestFlag restFlag) const { return (_restFlagMask & restFlag) != 0; }
|
||||
void SetRestFlag(RestFlag restFlag, uint32 triggerId = 0);
|
||||
void RemoveRestFlag(RestFlag restFlag);
|
||||
[[nodiscard]] uint32 GetInnTriggerId() const { return _innTriggerId; }
|
||||
|
||||
PetStable* GetPetStable() { return m_petStable.get(); }
|
||||
PetStable& GetOrInitPetStable();
|
||||
PetStable const* GetPetStable() const { return m_petStable.get(); }
|
||||
[[nodiscard]] PetStable const* GetPetStable() const { return m_petStable.get(); }
|
||||
|
||||
[[nodiscard]] Pet* GetPet() const;
|
||||
Pet* SummonPet(uint32 entry, float x, float y, float z, float ang, PetType petType, Milliseconds duration = 0s);
|
||||
@@ -1598,7 +1598,7 @@ public:
|
||||
uint32 GetMailSize() { return m_mail.size();}
|
||||
Mail* GetMail(uint32 id);
|
||||
|
||||
PlayerMails const& GetMails() const { return m_mail; }
|
||||
[[nodiscard]] PlayerMails const& GetMails() const { return m_mail; }
|
||||
void SendItemRetrievalMail(uint32 itemEntry, uint32 count); // Item retrieval mails sent by The Postmaster (34337)
|
||||
void SendItemRetrievalMail(std::vector<std::pair<uint32, uint32>> mailItems); // Item retrieval mails sent by The Postmaster (34337)
|
||||
|
||||
@@ -1861,7 +1861,7 @@ public:
|
||||
SetArenaTeamInfoField(slot, ARENA_TEAM_TYPE, type);
|
||||
}
|
||||
void SetArenaTeamInfoField(uint8 slot, ArenaTeamInfoType type, uint32 value);
|
||||
uint32 GetArenaPersonalRating(uint8 slot) const;
|
||||
[[nodiscard]] uint32 GetArenaPersonalRating(uint8 slot) const;
|
||||
static uint32 GetArenaTeamIdFromDB(ObjectGuid guid, uint8 slot);
|
||||
static void LeaveAllArenaTeams(ObjectGuid guid);
|
||||
[[nodiscard]] uint32 GetArenaTeamId(uint8 slot) const;
|
||||
@@ -1987,8 +1987,8 @@ public:
|
||||
void RemoveCorpse();
|
||||
void KillPlayer();
|
||||
static void OfflineResurrect(ObjectGuid const guid, CharacterDatabaseTransaction trans);
|
||||
bool HasCorpse() const { return _corpseLocation.GetMapId() != MAPID_INVALID; }
|
||||
WorldLocation GetCorpseLocation() const { return _corpseLocation; }
|
||||
[[nodiscard]] bool HasCorpse() const { return _corpseLocation.GetMapId() != MAPID_INVALID; }
|
||||
[[nodiscard]] WorldLocation GetCorpseLocation() const { return _corpseLocation; }
|
||||
uint32 GetResurrectionSpellId();
|
||||
void ResurrectPlayer(float restore_percent, bool applySickness = false);
|
||||
void BuildPlayerRepop();
|
||||
@@ -2394,7 +2394,7 @@ public:
|
||||
void SendCinematicStart(uint32 CinematicSequenceId);
|
||||
void SendMovieStart(uint32 MovieId);
|
||||
|
||||
uint16 GetMaxSkillValueForLevel() const;
|
||||
[[nodiscard]] uint16 GetMaxSkillValueForLevel() const;
|
||||
bool IsFFAPvP();
|
||||
bool IsPvP();
|
||||
|
||||
@@ -2591,7 +2591,7 @@ public:
|
||||
|
||||
void SetFarSightDistance(float radius);
|
||||
void ResetFarSightDistance();
|
||||
Optional<float> GetFarSightDistance() const;
|
||||
[[nodiscard]] Optional<float> GetFarSightDistance() const;
|
||||
|
||||
float GetSightRange(const WorldObject* target = nullptr) const override;
|
||||
|
||||
|
||||
@@ -28,6 +28,7 @@
|
||||
#include "SpellDefines.h"
|
||||
#include "ThreatMgr.h"
|
||||
#include <functional>
|
||||
#include <utility>
|
||||
|
||||
#define WORLD_TRIGGER 12999
|
||||
|
||||
@@ -909,7 +910,7 @@ uint32 createProcExtendMask(SpellNonMeleeDamage* damageInfo, SpellMissInfo missC
|
||||
|
||||
struct RedirectThreatInfo
|
||||
{
|
||||
RedirectThreatInfo() { }
|
||||
RedirectThreatInfo() = default;
|
||||
ObjectGuid _targetGUID;
|
||||
uint32 _threatPct{0};
|
||||
|
||||
@@ -1138,7 +1139,7 @@ private:
|
||||
};
|
||||
|
||||
struct AttackPosition {
|
||||
AttackPosition(Position pos) : _pos(pos), _taken(false) {}
|
||||
AttackPosition(Position pos) : _pos(std::move(pos)), _taken(false) {}
|
||||
bool operator==(const int val)
|
||||
{
|
||||
return !val;
|
||||
@@ -1982,7 +1983,7 @@ public:
|
||||
[[nodiscard]] Spell* FindCurrentSpellBySpellId(uint32 spell_id) const;
|
||||
[[nodiscard]] int32 GetCurrentSpellCastTime(uint32 spell_id) const;
|
||||
|
||||
virtual bool IsMovementPreventedByCasting() const;
|
||||
[[nodiscard]] virtual bool IsMovementPreventedByCasting() const;
|
||||
|
||||
ObjectGuid m_SummonSlot[MAX_SUMMON_SLOT];
|
||||
ObjectGuid m_ObjectSlot[MAX_GAMEOBJECT_SLOT];
|
||||
@@ -2506,7 +2507,7 @@ private:
|
||||
|
||||
uint32 _oldFactionId; ///< faction before charm
|
||||
|
||||
float processDummyAuras(float TakenTotalMod) const;
|
||||
[[nodiscard]] float processDummyAuras(float TakenTotalMod) const;
|
||||
};
|
||||
|
||||
namespace Acore
|
||||
|
||||
Reference in New Issue
Block a user