mirror of
https://github.com/liyunfan1223/azerothcore-wotlk.git
synced 2026-08-09 08:17:56 +00:00
refactor(Core): apply clang-tidy modernize-use-default-member-init (#3827)
This commit is contained in:
@@ -352,22 +352,19 @@ protected:
|
|||||||
class BuildStats
|
class BuildStats
|
||||||
{
|
{
|
||||||
private:
|
private:
|
||||||
int numNodes;
|
int numNodes{0};
|
||||||
int numLeaves;
|
int numLeaves{0};
|
||||||
int sumObjects;
|
int sumObjects{0};
|
||||||
int minObjects;
|
int minObjects{0x0FFFFFFF};
|
||||||
int maxObjects;
|
int maxObjects{-1}; // 0xFFFFFFFF
|
||||||
int sumDepth;
|
int sumDepth{0};
|
||||||
int minDepth;
|
int minDepth{0x0FFFFFFF};
|
||||||
int maxDepth;
|
int maxDepth{-1}; // 0xFFFFFFFF
|
||||||
int numLeavesN[6];
|
int numLeavesN[6];
|
||||||
int numBVH2;
|
int numBVH2{0};
|
||||||
|
|
||||||
public:
|
public:
|
||||||
BuildStats():
|
BuildStats()
|
||||||
numNodes(0), numLeaves(0), sumObjects(0), minObjects(0x0FFFFFFF),
|
|
||||||
maxObjects(0xFFFFFFFF), sumDepth(0), minDepth(0x0FFFFFFF),
|
|
||||||
maxDepth(0xFFFFFFFF), numBVH2(0)
|
|
||||||
{
|
{
|
||||||
for (int & i : numLeavesN) i = 0;
|
for (int & i : numLeavesN) i = 0;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -33,11 +33,11 @@ namespace VMAP
|
|||||||
class IVMapManager
|
class IVMapManager
|
||||||
{
|
{
|
||||||
private:
|
private:
|
||||||
bool iEnableLineOfSightCalc;
|
bool iEnableLineOfSightCalc{true};
|
||||||
bool iEnableHeightCalc;
|
bool iEnableHeightCalc{true};
|
||||||
|
|
||||||
public:
|
public:
|
||||||
IVMapManager() : iEnableLineOfSightCalc(true), iEnableHeightCalc(true) { }
|
IVMapManager() { }
|
||||||
|
|
||||||
virtual ~IVMapManager() = default;
|
virtual ~IVMapManager() = default;
|
||||||
|
|
||||||
|
|||||||
@@ -52,14 +52,14 @@ namespace VMAP
|
|||||||
class ManagedModel
|
class ManagedModel
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
ManagedModel() : iModel(nullptr), iRefCount(0) { }
|
ManagedModel() { }
|
||||||
void setModel(WorldModel* model) { iModel = model; }
|
void setModel(WorldModel* model) { iModel = model; }
|
||||||
WorldModel* getModel() { return iModel; }
|
WorldModel* getModel() { return iModel; }
|
||||||
void incRefCount() { ++iRefCount; }
|
void incRefCount() { ++iRefCount; }
|
||||||
int decRefCount() { return --iRefCount; }
|
int decRefCount() { return --iRefCount; }
|
||||||
protected:
|
protected:
|
||||||
WorldModel* iModel;
|
WorldModel* iModel{nullptr};
|
||||||
int iRefCount;
|
int iRefCount{0};
|
||||||
};
|
};
|
||||||
|
|
||||||
typedef std::unordered_map<uint32, StaticMapTree*> InstanceTreeMap;
|
typedef std::unordered_map<uint32, StaticMapTree*> InstanceTreeMap;
|
||||||
|
|||||||
@@ -19,9 +19,9 @@ namespace VMAP
|
|||||||
|
|
||||||
struct LocationInfo
|
struct LocationInfo
|
||||||
{
|
{
|
||||||
LocationInfo(): hitInstance(nullptr), hitModel(nullptr), ground_Z(-G3D::inf()) { }
|
LocationInfo(): ground_Z(-G3D::inf()) { }
|
||||||
const ModelInstance* hitInstance;
|
const ModelInstance* hitInstance{nullptr};
|
||||||
const GroupModel* hitModel;
|
const GroupModel* hitModel{nullptr};
|
||||||
float ground_Z;
|
float ground_Z;
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -73,14 +73,13 @@ namespace VMAP
|
|||||||
|
|
||||||
struct AreaInfo
|
struct AreaInfo
|
||||||
{
|
{
|
||||||
AreaInfo(): result(false), ground_Z(-G3D::inf()), flags(0), adtId(0),
|
AreaInfo(): ground_Z(-G3D::inf()) { }
|
||||||
rootId(0), groupId(0) { }
|
bool result{false};
|
||||||
bool result;
|
|
||||||
float ground_Z;
|
float ground_Z;
|
||||||
uint32 flags;
|
uint32 flags{0};
|
||||||
int32 adtId;
|
int32 adtId{0};
|
||||||
int32 rootId;
|
int32 rootId{0};
|
||||||
int32 groupId;
|
int32 groupId{0};
|
||||||
};
|
};
|
||||||
} // VMAP
|
} // VMAP
|
||||||
|
|
||||||
|
|||||||
@@ -28,10 +28,10 @@ namespace VMAP
|
|||||||
private:
|
private:
|
||||||
G3D::Matrix3 iRotation;
|
G3D::Matrix3 iRotation;
|
||||||
public:
|
public:
|
||||||
ModelPosition(): iScale(0.0f) { }
|
ModelPosition() { }
|
||||||
G3D::Vector3 iPos;
|
G3D::Vector3 iPos;
|
||||||
G3D::Vector3 iDir;
|
G3D::Vector3 iDir;
|
||||||
float iScale;
|
float iScale{0.0f};
|
||||||
void init()
|
void init()
|
||||||
{
|
{
|
||||||
iRotation = G3D::Matrix3::fromEulerAnglesZYX(G3D::pif() * iDir.y / 180.f, G3D::pif() * iDir.x / 180.f, G3D::pif() * iDir.z / 180.f);
|
iRotation = G3D::Matrix3::fromEulerAnglesZYX(G3D::pif() * iDir.y / 180.f, G3D::pif() * iDir.x / 180.f, G3D::pif() * iDir.z / 180.f);
|
||||||
@@ -54,17 +54,18 @@ namespace VMAP
|
|||||||
|
|
||||||
struct GroupModel_Raw
|
struct GroupModel_Raw
|
||||||
{
|
{
|
||||||
uint32 mogpflags;
|
uint32 mogpflags{0};
|
||||||
uint32 GroupWMOID;
|
uint32 GroupWMOID{0};
|
||||||
|
|
||||||
G3D::AABox bounds;
|
G3D::AABox bounds;
|
||||||
uint32 liquidflags;
|
uint32 liquidflags{0};
|
||||||
std::vector<MeshTriangle> triangles;
|
std::vector<MeshTriangle> triangles;
|
||||||
std::vector<G3D::Vector3> vertexArray;
|
std::vector<G3D::Vector3> vertexArray;
|
||||||
class WmoLiquid* liquid;
|
class WmoLiquid* liquid;
|
||||||
|
|
||||||
GroupModel_Raw() : mogpflags(0), GroupWMOID(0), liquidflags(0),
|
|
||||||
liquid(nullptr) { }
|
GroupModel_Raw() : liquid(nullptr) { }
|
||||||
|
|
||||||
~GroupModel_Raw();
|
~GroupModel_Raw();
|
||||||
|
|
||||||
bool Read(FILE* f);
|
bool Read(FILE* f);
|
||||||
|
|||||||
@@ -24,17 +24,18 @@ struct GameObjectDisplayInfoEntry;
|
|||||||
|
|
||||||
class GameObjectModel /*, public Intersectable*/
|
class GameObjectModel /*, public Intersectable*/
|
||||||
{
|
{
|
||||||
uint32 phasemask;
|
uint32 phasemask{0};
|
||||||
G3D::AABox iBound;
|
G3D::AABox iBound;
|
||||||
G3D::Matrix3 iInvRot;
|
G3D::Matrix3 iInvRot;
|
||||||
G3D::Vector3 iPos;
|
G3D::Vector3 iPos;
|
||||||
//G3D::Vector3 iRot;
|
//G3D::Vector3 iRot;
|
||||||
float iInvScale;
|
float iInvScale{0};
|
||||||
float iScale;
|
float iScale{0};
|
||||||
VMAP::WorldModel* iModel;
|
VMAP::WorldModel* iModel;
|
||||||
GameObject const* owner;
|
GameObject const* owner;
|
||||||
|
|
||||||
GameObjectModel() : phasemask(0), iInvScale(0), iScale(0), iModel(nullptr), owner(nullptr) { }
|
|
||||||
|
GameObjectModel() : iModel(nullptr), owner(nullptr) { }
|
||||||
bool initialize(const GameObject& go, const GameObjectDisplayInfoEntry& info);
|
bool initialize(const GameObject& go, const GameObjectDisplayInfoEntry& info);
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|||||||
@@ -51,7 +51,7 @@ namespace VMAP
|
|||||||
class ModelInstance: public ModelSpawn
|
class ModelInstance: public ModelSpawn
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
ModelInstance(): iInvScale(0.0f), iModel(nullptr) { }
|
ModelInstance() { }
|
||||||
ModelInstance(const ModelSpawn& spawn, WorldModel* model);
|
ModelInstance(const ModelSpawn& spawn, WorldModel* model);
|
||||||
void setUnloaded() { iModel = nullptr; }
|
void setUnloaded() { iModel = nullptr; }
|
||||||
bool intersectRay(const G3D::Ray& pRay, float& pMaxDist, bool StopAtFirstHit) const;
|
bool intersectRay(const G3D::Ray& pRay, float& pMaxDist, bool StopAtFirstHit) const;
|
||||||
@@ -60,8 +60,8 @@ namespace VMAP
|
|||||||
bool GetLiquidLevel(const G3D::Vector3& p, LocationInfo& info, float& liqHeight) const;
|
bool GetLiquidLevel(const G3D::Vector3& p, LocationInfo& info, float& liqHeight) const;
|
||||||
protected:
|
protected:
|
||||||
G3D::Matrix3 iInvRot;
|
G3D::Matrix3 iInvRot;
|
||||||
float iInvScale;
|
float iInvScale{0.0f};
|
||||||
WorldModel* iModel;
|
WorldModel* iModel{nullptr};
|
||||||
public:
|
public:
|
||||||
WorldModel* getWorldModel();
|
WorldModel* getWorldModel();
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -24,12 +24,12 @@ namespace VMAP
|
|||||||
class MeshTriangle
|
class MeshTriangle
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
MeshTriangle() : idx0(0), idx1(0), idx2(0) { }
|
MeshTriangle() { }
|
||||||
MeshTriangle(uint32 na, uint32 nb, uint32 nc): idx0(na), idx1(nb), idx2(nc) { }
|
MeshTriangle(uint32 na, uint32 nb, uint32 nc): idx0(na), idx1(nb), idx2(nc) { }
|
||||||
|
|
||||||
uint32 idx0;
|
uint32 idx0{0};
|
||||||
uint32 idx1;
|
uint32 idx1{0};
|
||||||
uint32 idx2;
|
uint32 idx2{0};
|
||||||
};
|
};
|
||||||
|
|
||||||
class WmoLiquid
|
class WmoLiquid
|
||||||
@@ -47,13 +47,13 @@ namespace VMAP
|
|||||||
bool writeToFile(FILE* wf);
|
bool writeToFile(FILE* wf);
|
||||||
static bool readFromFile(FILE* rf, WmoLiquid*& liquid);
|
static bool readFromFile(FILE* rf, WmoLiquid*& liquid);
|
||||||
private:
|
private:
|
||||||
WmoLiquid(): iTilesX(0), iTilesY(0), iType(0), iHeight(nullptr), iFlags(nullptr) { }
|
WmoLiquid() { }
|
||||||
uint32 iTilesX; //!< number of tiles in x direction, each
|
uint32 iTilesX{0}; //!< number of tiles in x direction, each
|
||||||
uint32 iTilesY;
|
uint32 iTilesY{0};
|
||||||
G3D::Vector3 iCorner; //!< the lower corner
|
G3D::Vector3 iCorner; //!< the lower corner
|
||||||
uint32 iType; //!< liquid type
|
uint32 iType{0}; //!< liquid type
|
||||||
float* iHeight; //!< (tilesX + 1)*(tilesY + 1) height values
|
float* iHeight{nullptr}; //!< (tilesX + 1)*(tilesY + 1) height values
|
||||||
uint8* iFlags; //!< info if liquid tile is used
|
uint8* iFlags{nullptr}; //!< info if liquid tile is used
|
||||||
public:
|
public:
|
||||||
void getPosInfo(uint32& tilesX, uint32& tilesY, G3D::Vector3& corner) const;
|
void getPosInfo(uint32& tilesX, uint32& tilesY, G3D::Vector3& corner) const;
|
||||||
};
|
};
|
||||||
@@ -62,7 +62,7 @@ namespace VMAP
|
|||||||
class GroupModel
|
class GroupModel
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
GroupModel(): iMogpFlags(0), iGroupWMOID(0), iLiquid(nullptr) { }
|
GroupModel() { }
|
||||||
GroupModel(const GroupModel& other);
|
GroupModel(const GroupModel& other);
|
||||||
GroupModel(uint32 mogpFlags, uint32 groupWMOID, const G3D::AABox& bound):
|
GroupModel(uint32 mogpFlags, uint32 groupWMOID, const G3D::AABox& bound):
|
||||||
iBound(bound), iMogpFlags(mogpFlags), iGroupWMOID(groupWMOID), iLiquid(nullptr) { }
|
iBound(bound), iMogpFlags(mogpFlags), iGroupWMOID(groupWMOID), iLiquid(nullptr) { }
|
||||||
@@ -82,12 +82,12 @@ namespace VMAP
|
|||||||
[[nodiscard]] uint32 GetWmoID() const { return iGroupWMOID; }
|
[[nodiscard]] uint32 GetWmoID() const { return iGroupWMOID; }
|
||||||
protected:
|
protected:
|
||||||
G3D::AABox iBound;
|
G3D::AABox iBound;
|
||||||
uint32 iMogpFlags;// 0x8 outdor; 0x2000 indoor
|
uint32 iMogpFlags{0};// 0x8 outdor; 0x2000 indoor
|
||||||
uint32 iGroupWMOID;
|
uint32 iGroupWMOID{0};
|
||||||
std::vector<G3D::Vector3> vertices;
|
std::vector<G3D::Vector3> vertices;
|
||||||
std::vector<MeshTriangle> triangles;
|
std::vector<MeshTriangle> triangles;
|
||||||
BIH meshTree;
|
BIH meshTree;
|
||||||
WmoLiquid* iLiquid;
|
WmoLiquid* iLiquid{nullptr};
|
||||||
public:
|
public:
|
||||||
void getMeshData(std::vector<G3D::Vector3>& vertices, std::vector<MeshTriangle>& triangles, WmoLiquid*& liquid);
|
void getMeshData(std::vector<G3D::Vector3>& vertices, std::vector<MeshTriangle>& triangles, WmoLiquid*& liquid);
|
||||||
};
|
};
|
||||||
@@ -95,7 +95,7 @@ namespace VMAP
|
|||||||
class WorldModel
|
class WorldModel
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
WorldModel(): RootWMOID(0) { }
|
WorldModel() { }
|
||||||
|
|
||||||
//! pass group models to WorldModel and create BIH. Passed vector is swapped with old geometry!
|
//! pass group models to WorldModel and create BIH. Passed vector is swapped with old geometry!
|
||||||
void setGroupModels(std::vector<GroupModel>& models);
|
void setGroupModels(std::vector<GroupModel>& models);
|
||||||
@@ -106,7 +106,7 @@ namespace VMAP
|
|||||||
bool writeFile(const std::string& filename);
|
bool writeFile(const std::string& filename);
|
||||||
bool readFile(const std::string& filename);
|
bool readFile(const std::string& filename);
|
||||||
protected:
|
protected:
|
||||||
uint32 RootWMOID;
|
uint32 RootWMOID{0};
|
||||||
std::vector<GroupModel> groupModels;
|
std::vector<GroupModel> groupModels;
|
||||||
BIH groupTree;
|
BIH groupTree;
|
||||||
public:
|
public:
|
||||||
|
|||||||
@@ -22,7 +22,7 @@ class Transaction
|
|||||||
friend class DatabaseWorkerPool;
|
friend class DatabaseWorkerPool;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
Transaction() : _cleanedUp(false) { }
|
Transaction() { }
|
||||||
~Transaction() { Cleanup(); }
|
~Transaction() { Cleanup(); }
|
||||||
|
|
||||||
void Append(PreparedStatement* statement);
|
void Append(PreparedStatement* statement);
|
||||||
@@ -36,7 +36,7 @@ protected:
|
|||||||
std::list<SQLElementData> m_queries;
|
std::list<SQLElementData> m_queries;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
bool _cleanedUp;
|
bool _cleanedUp{false};
|
||||||
};
|
};
|
||||||
|
|
||||||
typedef std::shared_ptr<Transaction> SQLTransaction;
|
typedef std::shared_ptr<Transaction> SQLTransaction;
|
||||||
|
|||||||
@@ -73,9 +73,9 @@ class LinkedListHead
|
|||||||
private:
|
private:
|
||||||
LinkedListElement iFirst;
|
LinkedListElement iFirst;
|
||||||
LinkedListElement iLast;
|
LinkedListElement iLast;
|
||||||
uint32 iSize;
|
uint32 iSize{0};
|
||||||
public:
|
public:
|
||||||
LinkedListHead(): iSize(0)
|
LinkedListHead()
|
||||||
{
|
{
|
||||||
// create empty list
|
// create empty list
|
||||||
|
|
||||||
|
|||||||
@@ -53,7 +53,7 @@ public:
|
|||||||
const static size_t DEFAULT_SIZE = 0x1000;
|
const static size_t DEFAULT_SIZE = 0x1000;
|
||||||
|
|
||||||
// constructor
|
// constructor
|
||||||
ByteBuffer() : _rpos(0), _wpos(0)
|
ByteBuffer()
|
||||||
{
|
{
|
||||||
_storage.reserve(DEFAULT_SIZE);
|
_storage.reserve(DEFAULT_SIZE);
|
||||||
}
|
}
|
||||||
@@ -503,7 +503,7 @@ public:
|
|||||||
void hexlike(bool outString = false) const;
|
void hexlike(bool outString = false) const;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
size_t _rpos, _wpos;
|
size_t _rpos{0}, _wpos{0};
|
||||||
std::vector<uint8> _storage;
|
std::vector<uint8> _storage;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -14,7 +14,7 @@ class WorldPacket : public ByteBuffer
|
|||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
// just container for later use
|
// just container for later use
|
||||||
WorldPacket() : ByteBuffer(0), m_opcode(0)
|
WorldPacket() : ByteBuffer(0)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
explicit WorldPacket(uint16 opcode, size_t res = 200) : ByteBuffer(res), m_opcode(opcode) { }
|
explicit WorldPacket(uint16 opcode, size_t res = 200) : ByteBuffer(res), m_opcode(opcode) { }
|
||||||
@@ -40,6 +40,6 @@ public:
|
|||||||
void SetOpcode(uint16 opcode) { m_opcode = opcode; }
|
void SetOpcode(uint16 opcode) { m_opcode = opcode; }
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
uint16 m_opcode;
|
uint16 m_opcode{0};
|
||||||
};
|
};
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -25,13 +25,13 @@ namespace ACE_Based
|
|||||||
StorageType _queue;
|
StorageType _queue;
|
||||||
|
|
||||||
//! Cancellation flag.
|
//! Cancellation flag.
|
||||||
volatile bool _canceled;
|
volatile bool _canceled{false};
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
//! Create a LockedQueue.
|
//! Create a LockedQueue.
|
||||||
LockedQueue()
|
LockedQueue()
|
||||||
: _canceled(false)
|
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -53,7 +53,7 @@ struct IntervalTimer
|
|||||||
public:
|
public:
|
||||||
|
|
||||||
IntervalTimer()
|
IntervalTimer()
|
||||||
: _interval(0), _current(0)
|
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -97,8 +97,8 @@ public:
|
|||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
||||||
time_t _interval;
|
time_t _interval{0};
|
||||||
time_t _current;
|
time_t _current{0};
|
||||||
};
|
};
|
||||||
|
|
||||||
struct TimeTracker
|
struct TimeTracker
|
||||||
|
|||||||
@@ -578,7 +578,7 @@ class EventMap
|
|||||||
typedef std::multimap<uint32, uint32> EventStore;
|
typedef std::multimap<uint32, uint32> EventStore;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
EventMap() : _time(0), _phase(0), _lastEvent(0) { }
|
EventMap() { }
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @name Reset
|
* @name Reset
|
||||||
@@ -908,9 +908,9 @@ public:
|
|||||||
}
|
}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
uint32 _time;
|
uint32 _time{0};
|
||||||
uint32 _phase;
|
uint32 _phase{0};
|
||||||
uint32 _lastEvent;
|
uint32 _lastEvent{0};
|
||||||
|
|
||||||
EventStore _eventMap;
|
EventStore _eventMap;
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -69,7 +69,7 @@ class Unit;
|
|||||||
|
|
||||||
struct AchievementCriteriaData
|
struct AchievementCriteriaData
|
||||||
{
|
{
|
||||||
AchievementCriteriaDataType dataType;
|
AchievementCriteriaDataType dataType{ACHIEVEMENT_CRITERIA_DATA_TYPE_NONE};
|
||||||
union
|
union
|
||||||
{
|
{
|
||||||
// ACHIEVEMENT_CRITERIA_DATA_TYPE_NONE = 0 (no data)
|
// ACHIEVEMENT_CRITERIA_DATA_TYPE_NONE = 0 (no data)
|
||||||
@@ -186,7 +186,7 @@ struct AchievementCriteriaData
|
|||||||
};
|
};
|
||||||
uint32 ScriptId;
|
uint32 ScriptId;
|
||||||
|
|
||||||
AchievementCriteriaData() : dataType(ACHIEVEMENT_CRITERIA_DATA_TYPE_NONE)
|
AchievementCriteriaData()
|
||||||
{
|
{
|
||||||
raw.value1 = 0;
|
raw.value1 = 0;
|
||||||
raw.value2 = 0;
|
raw.value2 = 0;
|
||||||
@@ -206,13 +206,13 @@ struct AchievementCriteriaData
|
|||||||
|
|
||||||
struct AchievementCriteriaDataSet
|
struct AchievementCriteriaDataSet
|
||||||
{
|
{
|
||||||
AchievementCriteriaDataSet() : criteria_id(0) {}
|
AchievementCriteriaDataSet() {}
|
||||||
typedef std::vector<AchievementCriteriaData> Storage;
|
typedef std::vector<AchievementCriteriaData> Storage;
|
||||||
void Add(AchievementCriteriaData const& data) { storage.push_back(data); }
|
void Add(AchievementCriteriaData const& data) { storage.push_back(data); }
|
||||||
bool Meets(Player const* source, Unit const* target, uint32 miscvalue = 0) const;
|
bool Meets(Player const* source, Unit const* target, uint32 miscvalue = 0) const;
|
||||||
void SetCriteriaId(uint32 id) {criteria_id = id;}
|
void SetCriteriaId(uint32 id) {criteria_id = id;}
|
||||||
private:
|
private:
|
||||||
uint32 criteria_id;
|
uint32 criteria_id{0};
|
||||||
Storage storage;
|
Storage storage;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -174,11 +174,11 @@ enum BattlegroundTeams
|
|||||||
|
|
||||||
struct BattlegroundObjectInfo
|
struct BattlegroundObjectInfo
|
||||||
{
|
{
|
||||||
BattlegroundObjectInfo() : object(nullptr), timer(0), spellid(0) {}
|
BattlegroundObjectInfo() {}
|
||||||
|
|
||||||
GameObject* object;
|
GameObject* object{nullptr};
|
||||||
int32 timer;
|
int32 timer{0};
|
||||||
uint32 spellid;
|
uint32 spellid{0};
|
||||||
};
|
};
|
||||||
|
|
||||||
enum ScoreType
|
enum ScoreType
|
||||||
@@ -273,7 +273,7 @@ struct BattlegroundScore
|
|||||||
class ArenaLogEntryData
|
class ArenaLogEntryData
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
ArenaLogEntryData() : Guid(0), ArenaTeamId(0), DamageDone(0), HealingDone(0), KillingBlows(0) {}
|
ArenaLogEntryData() {}
|
||||||
void Fill(const char* name, uint32 guid, uint32 acc, uint32 arenaTeamId, std::string ip)
|
void Fill(const char* name, uint32 guid, uint32 acc, uint32 arenaTeamId, std::string ip)
|
||||||
{
|
{
|
||||||
Name = std::string(name);
|
Name = std::string(name);
|
||||||
@@ -284,13 +284,13 @@ public:
|
|||||||
}
|
}
|
||||||
|
|
||||||
std::string Name;
|
std::string Name;
|
||||||
uint32 Guid;
|
uint32 Guid{0};
|
||||||
uint32 Acc;
|
uint32 Acc;
|
||||||
uint32 ArenaTeamId;
|
uint32 ArenaTeamId{0};
|
||||||
std::string IP;
|
std::string IP;
|
||||||
uint32 DamageDone;
|
uint32 DamageDone{0};
|
||||||
uint32 HealingDone;
|
uint32 HealingDone{0};
|
||||||
uint32 KillingBlows;
|
uint32 KillingBlows{0};
|
||||||
};
|
};
|
||||||
|
|
||||||
enum BGHonorMode
|
enum BGHonorMode
|
||||||
|
|||||||
@@ -128,7 +128,7 @@ class ThreatContainer
|
|||||||
public:
|
public:
|
||||||
typedef std::list<HostileReference*> StorageType;
|
typedef std::list<HostileReference*> StorageType;
|
||||||
|
|
||||||
ThreatContainer(): iDirty(false) { }
|
ThreatContainer() { }
|
||||||
|
|
||||||
~ThreatContainer() { clearReferences(); }
|
~ThreatContainer() { clearReferences(); }
|
||||||
|
|
||||||
@@ -173,7 +173,7 @@ private:
|
|||||||
void update();
|
void update();
|
||||||
|
|
||||||
StorageType iThreatList;
|
StorageType iThreatList;
|
||||||
bool iDirty;
|
bool iDirty{false};
|
||||||
};
|
};
|
||||||
|
|
||||||
//=================================================
|
//=================================================
|
||||||
|
|||||||
@@ -251,31 +251,28 @@ typedef std::unordered_map<uint32, EquipmentInfoContainerInternal> EquipmentInfo
|
|||||||
// from `creature` table
|
// from `creature` table
|
||||||
struct CreatureData
|
struct CreatureData
|
||||||
{
|
{
|
||||||
CreatureData() : id(0), mapid(0), phaseMask(0), displayid(0), equipmentId(0),
|
CreatureData() { }
|
||||||
posX(0.0f), posY(0.0f), posZ(0.0f), orientation(0.0f), spawntimesecs(0),
|
uint32 id{0}; // entry in creature_template
|
||||||
wander_distance(0.0f), currentwaypoint(0), curhealth(0), curmana(0), movementType(0),
|
uint16 mapid{0};
|
||||||
spawnMask(0), npcflag(0), unit_flags(0), dynamicflags(0), dbData(true), overwrittenZ(false) { }
|
uint32 phaseMask{0};
|
||||||
uint32 id; // entry in creature_template
|
uint32 displayid{0};
|
||||||
uint16 mapid;
|
int8 equipmentId{0};
|
||||||
uint32 phaseMask;
|
float posX{0.0f};
|
||||||
uint32 displayid;
|
float posY{0.0f};
|
||||||
int8 equipmentId;
|
float posZ{0.0f};
|
||||||
float posX;
|
float orientation{0.0f};
|
||||||
float posY;
|
uint32 spawntimesecs{0};
|
||||||
float posZ;
|
float wander_distance{0.0f};
|
||||||
float orientation;
|
uint32 currentwaypoint{0};
|
||||||
uint32 spawntimesecs;
|
uint32 curhealth{0};
|
||||||
float wander_distance;
|
uint32 curmana{0};
|
||||||
uint32 currentwaypoint;
|
uint8 movementType{0};
|
||||||
uint32 curhealth;
|
uint8 spawnMask{0};
|
||||||
uint32 curmana;
|
uint32 npcflag{0};
|
||||||
uint8 movementType;
|
uint32 unit_flags{0}; // enum UnitFlags mask values
|
||||||
uint8 spawnMask;
|
uint32 dynamicflags{0};
|
||||||
uint32 npcflag;
|
bool dbData{true};
|
||||||
uint32 unit_flags; // enum UnitFlags mask values
|
bool overwrittenZ{false};
|
||||||
uint32 dynamicflags;
|
|
||||||
bool dbData;
|
|
||||||
bool overwrittenZ;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
struct CreatureModelInfo
|
struct CreatureModelInfo
|
||||||
@@ -388,17 +385,17 @@ typedef std::list<VendorItemCount> VendorItemCounts;
|
|||||||
|
|
||||||
struct TrainerSpell
|
struct TrainerSpell
|
||||||
{
|
{
|
||||||
TrainerSpell() : spell(0), spellCost(0), reqSkill(0), reqSkillValue(0), reqLevel(0)
|
TrainerSpell()
|
||||||
{
|
{
|
||||||
for (unsigned int & i : learnedSpell)
|
for (unsigned int & i : learnedSpell)
|
||||||
i = 0;
|
i = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
uint32 spell;
|
uint32 spell{0};
|
||||||
uint32 spellCost;
|
uint32 spellCost{0};
|
||||||
uint32 reqSkill;
|
uint32 reqSkill{0};
|
||||||
uint32 reqSkillValue;
|
uint32 reqSkillValue{0};
|
||||||
uint32 reqLevel;
|
uint32 reqLevel{0};
|
||||||
uint32 learnedSpell[3];
|
uint32 learnedSpell[3];
|
||||||
|
|
||||||
// helpers
|
// helpers
|
||||||
@@ -409,11 +406,11 @@ typedef std::unordered_map<uint32 /*spellid*/, TrainerSpell> TrainerSpellMap;
|
|||||||
|
|
||||||
struct TrainerSpellData
|
struct TrainerSpellData
|
||||||
{
|
{
|
||||||
TrainerSpellData() : trainerType(0) {}
|
TrainerSpellData() {}
|
||||||
~TrainerSpellData() { spellList.clear(); }
|
~TrainerSpellData() { spellList.clear(); }
|
||||||
|
|
||||||
TrainerSpellMap spellList;
|
TrainerSpellMap spellList;
|
||||||
uint32 trainerType; // trainer type based at trainer spells, can be different from creature_template value.
|
uint32 trainerType{0}; // trainer type based at trainer spells, can be different from creature_template value.
|
||||||
// req. for correct show non-prof. trainers like weaponmaster, allowed values 0 and 2.
|
// req. for correct show non-prof. trainers like weaponmaster, allowed values 0 and 2.
|
||||||
[[nodiscard]] TrainerSpell const* Find(uint32 spell_id) const;
|
[[nodiscard]] TrainerSpell const* Find(uint32 spell_id) const;
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -688,22 +688,21 @@ enum GOState
|
|||||||
// from `gameobject`
|
// from `gameobject`
|
||||||
struct GameObjectData
|
struct GameObjectData
|
||||||
{
|
{
|
||||||
explicit GameObjectData() : id(0), mapid(0), phaseMask(0), posX(0.0f), posY(0.0f), posZ(0.0f), orientation(0.0f), spawntimesecs(0),
|
explicit GameObjectData() { }
|
||||||
animprogress(0), go_state(GO_STATE_ACTIVE), spawnMask(0), artKit(0), dbData(true) { }
|
uint32 id{0}; // entry in gamobject_template
|
||||||
uint32 id; // entry in gamobject_template
|
uint16 mapid{0};
|
||||||
uint16 mapid;
|
uint32 phaseMask{0};
|
||||||
uint32 phaseMask;
|
float posX{0.0f};
|
||||||
float posX;
|
float posY{0.0f};
|
||||||
float posY;
|
float posZ{0.0f};
|
||||||
float posZ;
|
float orientation{0.0f};
|
||||||
float orientation;
|
|
||||||
G3D::Quat rotation;
|
G3D::Quat rotation;
|
||||||
int32 spawntimesecs;
|
int32 spawntimesecs{0};
|
||||||
uint32 animprogress;
|
uint32 animprogress{0};
|
||||||
GOState go_state;
|
GOState go_state{GO_STATE_ACTIVE};
|
||||||
uint8 spawnMask;
|
uint8 spawnMask{0};
|
||||||
uint8 artKit;
|
uint8 artKit{0};
|
||||||
bool dbData;
|
bool dbData{true};
|
||||||
};
|
};
|
||||||
|
|
||||||
typedef std::vector<uint32> GameObjectQuestItemList;
|
typedef std::vector<uint32> GameObjectQuestItemList;
|
||||||
|
|||||||
@@ -597,11 +597,11 @@ ByteBuffer& operator >> (ByteBuffer& buf, Position::PositionXYZOStreamer const&
|
|||||||
struct MovementInfo
|
struct MovementInfo
|
||||||
{
|
{
|
||||||
// common
|
// common
|
||||||
uint64 guid;
|
uint64 guid{0};
|
||||||
uint32 flags;
|
uint32 flags{0};
|
||||||
uint16 flags2;
|
uint16 flags2{0};
|
||||||
Position pos;
|
Position pos;
|
||||||
uint32 time;
|
uint32 time{0};
|
||||||
|
|
||||||
// transport
|
// transport
|
||||||
struct TransportInfo
|
struct TransportInfo
|
||||||
@@ -623,10 +623,10 @@ struct MovementInfo
|
|||||||
} transport;
|
} transport;
|
||||||
|
|
||||||
// swimming/flying
|
// swimming/flying
|
||||||
float pitch;
|
float pitch{0.0f};
|
||||||
|
|
||||||
// falling
|
// falling
|
||||||
uint32 fallTime;
|
uint32 fallTime{0};
|
||||||
|
|
||||||
// jumping
|
// jumping
|
||||||
struct JumpInfo
|
struct JumpInfo
|
||||||
@@ -641,10 +641,9 @@ struct MovementInfo
|
|||||||
} jump;
|
} jump;
|
||||||
|
|
||||||
// spline
|
// spline
|
||||||
float splineElevation;
|
float splineElevation{0.0f};
|
||||||
|
|
||||||
MovementInfo() :
|
MovementInfo()
|
||||||
guid(0), flags(0), flags2(0), time(0), pitch(0.0f), fallTime(0), splineElevation(0.0f)
|
|
||||||
{
|
{
|
||||||
pos.Relocate(0.0f, 0.0f, 0.0f, 0.0f);
|
pos.Relocate(0.0f, 0.0f, 0.0f, 0.0f);
|
||||||
transport.Reset();
|
transport.Reset();
|
||||||
@@ -749,14 +748,14 @@ class MovableMapObject
|
|||||||
template<class T> friend class RandomMovementGenerator;
|
template<class T> friend class RandomMovementGenerator;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
MovableMapObject() : _moveState(MAP_OBJECT_CELL_MOVE_NONE) {}
|
MovableMapObject() {}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
[[nodiscard]] Cell const& GetCurrentCell() const { return _currentCell; }
|
[[nodiscard]] Cell const& GetCurrentCell() const { return _currentCell; }
|
||||||
void SetCurrentCell(Cell const& cell) { _currentCell = cell; }
|
void SetCurrentCell(Cell const& cell) { _currentCell = cell; }
|
||||||
|
|
||||||
Cell _currentCell;
|
Cell _currentCell;
|
||||||
MapObjectCellMoveState _moveState;
|
MapObjectCellMoveState _moveState{MAP_OBJECT_CELL_MOVE_NONE};
|
||||||
};
|
};
|
||||||
|
|
||||||
class WorldObject : public Object, public WorldLocation
|
class WorldObject : public Object, public WorldLocation
|
||||||
|
|||||||
@@ -22,7 +22,7 @@ public:
|
|||||||
CLIENT_UPDATE_MASK_BITS = sizeof(ClientUpdateMaskType) * 8,
|
CLIENT_UPDATE_MASK_BITS = sizeof(ClientUpdateMaskType) * 8,
|
||||||
};
|
};
|
||||||
|
|
||||||
UpdateMask() : _fieldCount(0), _blockCount(0), _bits(nullptr) { }
|
UpdateMask() { }
|
||||||
|
|
||||||
UpdateMask(UpdateMask const& right) : _bits(nullptr)
|
UpdateMask(UpdateMask const& right) : _bits(nullptr)
|
||||||
{
|
{
|
||||||
@@ -105,9 +105,9 @@ public:
|
|||||||
}
|
}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
uint32 _fieldCount;
|
uint32 _fieldCount{0};
|
||||||
uint32 _blockCount;
|
uint32 _blockCount{0};
|
||||||
uint8* _bits;
|
uint8* _bits{nullptr};
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -143,13 +143,13 @@ enum TalentTree // talent tabs
|
|||||||
// Spell modifier (used for modify other spells)
|
// Spell modifier (used for modify other spells)
|
||||||
struct SpellModifier
|
struct SpellModifier
|
||||||
{
|
{
|
||||||
SpellModifier(Aura* _ownerAura = nullptr) : op(SPELLMOD_DAMAGE), type(SPELLMOD_FLAT), charges(0), value(0), mask(), spellId(0), ownerAura(_ownerAura) {}
|
SpellModifier(Aura* _ownerAura = nullptr) : op(SPELLMOD_DAMAGE), type(SPELLMOD_FLAT), charges(0), mask(), ownerAura(_ownerAura) {}
|
||||||
SpellModOp op : 8;
|
SpellModOp op : 8;
|
||||||
SpellModType type : 8;
|
SpellModType type : 8;
|
||||||
int16 charges : 16;
|
int16 charges : 16;
|
||||||
int32 value;
|
int32 value{0};
|
||||||
flag96 mask;
|
flag96 mask;
|
||||||
uint32 spellId;
|
uint32 spellId{0};
|
||||||
Aura* const ownerAura;
|
Aura* const ownerAura;
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -214,10 +214,10 @@ enum ReputationSource
|
|||||||
|
|
||||||
struct ActionButton
|
struct ActionButton
|
||||||
{
|
{
|
||||||
ActionButton() : packedData(0), uState(ACTIONBUTTON_NEW) {}
|
ActionButton() {}
|
||||||
|
|
||||||
uint32 packedData;
|
uint32 packedData{0};
|
||||||
ActionButtonUpdateState uState;
|
ActionButtonUpdateState uState{ACTIONBUTTON_NEW};
|
||||||
|
|
||||||
// helpers
|
// helpers
|
||||||
[[nodiscard]] ActionButtonType GetType() const { return ActionButtonType(ACTION_BUTTON_TYPE(packedData)); }
|
[[nodiscard]] ActionButtonType GetType() const { return ActionButtonType(ACTION_BUTTON_TYPE(packedData)); }
|
||||||
@@ -250,16 +250,16 @@ typedef std::list<PlayerCreateInfoItem> PlayerCreateInfoItems;
|
|||||||
|
|
||||||
struct PlayerClassLevelInfo
|
struct PlayerClassLevelInfo
|
||||||
{
|
{
|
||||||
PlayerClassLevelInfo() : basehealth(0), basemana(0) {}
|
PlayerClassLevelInfo() {}
|
||||||
uint16 basehealth;
|
uint16 basehealth{0};
|
||||||
uint16 basemana;
|
uint16 basemana{0};
|
||||||
};
|
};
|
||||||
|
|
||||||
struct PlayerClassInfo
|
struct PlayerClassInfo
|
||||||
{
|
{
|
||||||
PlayerClassInfo() : levelInfo(nullptr) { }
|
PlayerClassInfo() { }
|
||||||
|
|
||||||
PlayerClassLevelInfo* levelInfo; //[level-1] 0..MaxPlayerLevel-1
|
PlayerClassLevelInfo* levelInfo{nullptr}; //[level-1] 0..MaxPlayerLevel-1
|
||||||
};
|
};
|
||||||
|
|
||||||
struct PlayerLevelInfo
|
struct PlayerLevelInfo
|
||||||
@@ -273,12 +273,12 @@ typedef std::list<uint32> PlayerCreateInfoSpells;
|
|||||||
|
|
||||||
struct PlayerCreateInfoAction
|
struct PlayerCreateInfoAction
|
||||||
{
|
{
|
||||||
PlayerCreateInfoAction() : button(0), type(0), action(0) {}
|
PlayerCreateInfoAction() {}
|
||||||
PlayerCreateInfoAction(uint8 _button, uint32 _action, uint8 _type) : button(_button), type(_type), action(_action) {}
|
PlayerCreateInfoAction(uint8 _button, uint32 _action, uint8 _type) : button(_button), type(_type), action(_action) {}
|
||||||
|
|
||||||
uint8 button;
|
uint8 button{0};
|
||||||
uint8 type;
|
uint8 type{0};
|
||||||
uint32 action;
|
uint32 action{0};
|
||||||
};
|
};
|
||||||
|
|
||||||
typedef std::list<PlayerCreateInfoAction> PlayerCreateInfoActions;
|
typedef std::list<PlayerCreateInfoAction> PlayerCreateInfoActions;
|
||||||
@@ -286,44 +286,44 @@ typedef std::list<PlayerCreateInfoAction> PlayerCreateInfoActions;
|
|||||||
struct PlayerInfo
|
struct PlayerInfo
|
||||||
{
|
{
|
||||||
// existence checked by displayId != 0
|
// existence checked by displayId != 0
|
||||||
PlayerInfo() : mapId(0), areaId(0), positionX(0.0f), positionY(0.0f), positionZ(0.0f), orientation(0.0f), displayId_m(0), displayId_f(0), levelInfo(nullptr) { }
|
PlayerInfo() { }
|
||||||
|
|
||||||
uint32 mapId;
|
uint32 mapId{0};
|
||||||
uint32 areaId;
|
uint32 areaId{0};
|
||||||
float positionX;
|
float positionX{0.0f};
|
||||||
float positionY;
|
float positionY{0.0f};
|
||||||
float positionZ;
|
float positionZ{0.0f};
|
||||||
float orientation;
|
float orientation{0.0f};
|
||||||
uint16 displayId_m;
|
uint16 displayId_m{0};
|
||||||
uint16 displayId_f;
|
uint16 displayId_f{0};
|
||||||
PlayerCreateInfoItems item;
|
PlayerCreateInfoItems item;
|
||||||
PlayerCreateInfoSpells spell;
|
PlayerCreateInfoSpells spell;
|
||||||
PlayerCreateInfoActions action;
|
PlayerCreateInfoActions action;
|
||||||
|
|
||||||
PlayerLevelInfo* levelInfo; //[level-1] 0..MaxPlayerLevel-1
|
PlayerLevelInfo* levelInfo{nullptr}; //[level-1] 0..MaxPlayerLevel-1
|
||||||
};
|
};
|
||||||
|
|
||||||
struct PvPInfo
|
struct PvPInfo
|
||||||
{
|
{
|
||||||
PvPInfo() : IsHostile(false), IsInHostileArea(false), IsInNoPvPArea(false), IsInFFAPvPArea(false), EndTimer(0) {}
|
PvPInfo() {}
|
||||||
|
|
||||||
bool IsHostile;
|
bool IsHostile{false};
|
||||||
bool IsInHostileArea; ///> Marks if player is in an area which forces PvP flag
|
bool IsInHostileArea{false}; ///> Marks if player is in an area which forces PvP flag
|
||||||
bool IsInNoPvPArea; ///> Marks if player is in a sanctuary or friendly capital city
|
bool IsInNoPvPArea{false}; ///> Marks if player is in a sanctuary or friendly capital city
|
||||||
bool IsInFFAPvPArea; ///> Marks if player is in an FFAPvP area (such as Gurubashi Arena)
|
bool IsInFFAPvPArea{false}; ///> Marks if player is in an FFAPvP area (such as Gurubashi Arena)
|
||||||
time_t EndTimer; ///> Time when player unflags himself for PvP (flag removed after 5 minutes)
|
time_t EndTimer{0}; ///> Time when player unflags himself for PvP (flag removed after 5 minutes)
|
||||||
};
|
};
|
||||||
|
|
||||||
struct DuelInfo
|
struct DuelInfo
|
||||||
{
|
{
|
||||||
DuelInfo() : initiator(nullptr), opponent(nullptr), startTimer(0), startTime(0), outOfBound(0), isMounted(false) {}
|
DuelInfo() {}
|
||||||
|
|
||||||
Player* initiator;
|
Player* initiator{nullptr};
|
||||||
Player* opponent;
|
Player* opponent{nullptr};
|
||||||
time_t startTimer;
|
time_t startTimer{0};
|
||||||
time_t startTime;
|
time_t startTime{0};
|
||||||
time_t outOfBound;
|
time_t outOfBound{0};
|
||||||
bool isMounted;
|
bool isMounted{false};
|
||||||
};
|
};
|
||||||
|
|
||||||
struct Areas
|
struct Areas
|
||||||
@@ -380,13 +380,13 @@ struct Runes
|
|||||||
|
|
||||||
struct EnchantDuration
|
struct EnchantDuration
|
||||||
{
|
{
|
||||||
EnchantDuration() : item(nullptr), slot(MAX_ENCHANTMENT_SLOT), leftduration(0) {};
|
EnchantDuration() {};
|
||||||
EnchantDuration(Item* _item, EnchantmentSlot _slot, uint32 _leftduration) : item(_item), slot(_slot),
|
EnchantDuration(Item* _item, EnchantmentSlot _slot, uint32 _leftduration) : item(_item), slot(_slot),
|
||||||
leftduration(_leftduration) { ASSERT(item); };
|
leftduration(_leftduration) { ASSERT(item); };
|
||||||
|
|
||||||
Item* item;
|
Item* item{nullptr};
|
||||||
EnchantmentSlot slot;
|
EnchantmentSlot slot{MAX_ENCHANTMENT_SLOT};
|
||||||
uint32 leftduration;
|
uint32 leftduration{0};
|
||||||
};
|
};
|
||||||
|
|
||||||
typedef std::list<EnchantDuration> EnchantDurationList;
|
typedef std::list<EnchantDuration> EnchantDurationList;
|
||||||
@@ -687,18 +687,18 @@ enum EquipmentSetUpdateState
|
|||||||
|
|
||||||
struct EquipmentSet
|
struct EquipmentSet
|
||||||
{
|
{
|
||||||
EquipmentSet() : Guid(0), IgnoreMask(0), state(EQUIPMENT_SET_NEW)
|
EquipmentSet()
|
||||||
{
|
{
|
||||||
for (unsigned int & Item : Items)
|
for (unsigned int & Item : Items)
|
||||||
Item = 0;
|
Item = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
uint64 Guid;
|
uint64 Guid{0};
|
||||||
std::string Name;
|
std::string Name;
|
||||||
std::string IconName;
|
std::string IconName;
|
||||||
uint32 IgnoreMask;
|
uint32 IgnoreMask{0};
|
||||||
uint32 Items[EQUIPMENT_SLOT_END];
|
uint32 Items[EQUIPMENT_SLOT_END];
|
||||||
EquipmentSetUpdateState state;
|
EquipmentSetUpdateState state{EQUIPMENT_SET_NEW};
|
||||||
};
|
};
|
||||||
|
|
||||||
#define MAX_EQUIPMENT_SET_INDEX 10 // client limit
|
#define MAX_EQUIPMENT_SET_INDEX 10 // client limit
|
||||||
@@ -1019,29 +1019,29 @@ class Player;
|
|||||||
// holder for Battleground data (pussywizard: not stored in db)
|
// holder for Battleground data (pussywizard: not stored in db)
|
||||||
struct BGData
|
struct BGData
|
||||||
{
|
{
|
||||||
BGData() : bgInstanceID(0), bgTypeID(BATTLEGROUND_TYPE_NONE), bgTeamId(TEAM_NEUTRAL), bgQueueSlot(PLAYER_MAX_BATTLEGROUND_QUEUES), isInvited(false), bgIsRandom(false), bgAfkReportedCount(0), bgAfkReportedTimer(0) {}
|
BGData() {}
|
||||||
|
|
||||||
uint32 bgInstanceID;
|
uint32 bgInstanceID{0};
|
||||||
BattlegroundTypeId bgTypeID;
|
BattlegroundTypeId bgTypeID{BATTLEGROUND_TYPE_NONE};
|
||||||
TeamId bgTeamId;
|
TeamId bgTeamId{TEAM_NEUTRAL};
|
||||||
uint32 bgQueueSlot;
|
uint32 bgQueueSlot{PLAYER_MAX_BATTLEGROUND_QUEUES};
|
||||||
bool isInvited;
|
bool isInvited{false};
|
||||||
bool bgIsRandom;
|
bool bgIsRandom{false};
|
||||||
|
|
||||||
std::set<uint32> bgAfkReporter;
|
std::set<uint32> bgAfkReporter;
|
||||||
uint8 bgAfkReportedCount;
|
uint8 bgAfkReportedCount{0};
|
||||||
time_t bgAfkReportedTimer;
|
time_t bgAfkReportedTimer{0};
|
||||||
};
|
};
|
||||||
|
|
||||||
// holder for Entry Point data (pussywizard: stored in db)
|
// holder for Entry Point data (pussywizard: stored in db)
|
||||||
struct EntryPointData
|
struct EntryPointData
|
||||||
{
|
{
|
||||||
EntryPointData() : mountSpell(0)
|
EntryPointData()
|
||||||
{
|
{
|
||||||
ClearTaxiPath();
|
ClearTaxiPath();
|
||||||
}
|
}
|
||||||
|
|
||||||
uint32 mountSpell;
|
uint32 mountSpell{0};
|
||||||
std::vector<uint32> taxiPath;
|
std::vector<uint32> taxiPath;
|
||||||
WorldLocation joinPos;
|
WorldLocation joinPos;
|
||||||
|
|
||||||
|
|||||||
@@ -1026,9 +1026,9 @@ uint32 createProcExtendMask(SpellNonMeleeDamage* damageInfo, SpellMissInfo missC
|
|||||||
|
|
||||||
struct RedirectThreatInfo
|
struct RedirectThreatInfo
|
||||||
{
|
{
|
||||||
RedirectThreatInfo() : _targetGUID(0), _threatPct(0) { }
|
RedirectThreatInfo() { }
|
||||||
uint64 _targetGUID;
|
uint64 _targetGUID{0};
|
||||||
uint32 _threatPct;
|
uint32 _threatPct{0};
|
||||||
|
|
||||||
[[nodiscard]] uint64 GetTargetGUID() const { return _targetGUID; }
|
[[nodiscard]] uint64 GetTargetGUID() const { return _targetGUID; }
|
||||||
[[nodiscard]] uint32 GetThreatPct() const { return _threatPct; }
|
[[nodiscard]] uint32 GetThreatPct() const { return _threatPct; }
|
||||||
|
|||||||
@@ -41,15 +41,15 @@ typedef std::map<uint32 /*condition id*/, GameEventFinishCondition> GameEventCon
|
|||||||
|
|
||||||
struct GameEventData
|
struct GameEventData
|
||||||
{
|
{
|
||||||
GameEventData() : start(1), end(0), nextstart(0), occurence(0), length(0), holiday_id(HOLIDAY_NONE), state(GAMEEVENT_NORMAL) { }
|
GameEventData() { }
|
||||||
time_t start; // occurs after this time
|
time_t start{1}; // occurs after this time
|
||||||
time_t end; // occurs before this time
|
time_t end{0}; // occurs before this time
|
||||||
time_t nextstart; // after this time the follow-up events count this phase completed
|
time_t nextstart{0}; // after this time the follow-up events count this phase completed
|
||||||
uint32 occurence; // time between end and start
|
uint32 occurence{0}; // time between end and start
|
||||||
uint32 length; // length of the event (minutes) after finishing all conditions
|
uint32 length{0}; // length of the event (minutes) after finishing all conditions
|
||||||
HolidayIds holiday_id;
|
HolidayIds holiday_id{HOLIDAY_NONE};
|
||||||
uint8 holidayStage;
|
uint8 holidayStage;
|
||||||
GameEventState state; // state of the game event, these are saved into the game_event table on change!
|
GameEventState state{GAMEEVENT_NORMAL}; // state of the game event, these are saved into the game_event table on change!
|
||||||
GameEventConditionMap conditions; // conditions to finish
|
GameEventConditionMap conditions; // conditions to finish
|
||||||
std::set<uint16 /*gameevent id*/> prerequisite_events; // events that must be completed before starting this event
|
std::set<uint16 /*gameevent id*/> prerequisite_events; // events that must be completed before starting this event
|
||||||
std::string description;
|
std::string description;
|
||||||
|
|||||||
@@ -421,26 +421,25 @@ struct AreaTrigger
|
|||||||
|
|
||||||
struct BroadcastText
|
struct BroadcastText
|
||||||
{
|
{
|
||||||
BroadcastText() : Id(0), Language(0), EmoteId0(0), EmoteId1(0), EmoteId2(0),
|
BroadcastText()
|
||||||
EmoteDelay0(0), EmoteDelay1(0), EmoteDelay2(0), SoundId(0), Unk1(0), Unk2(0)
|
|
||||||
{
|
{
|
||||||
MaleText.resize(DEFAULT_LOCALE + 1);
|
MaleText.resize(DEFAULT_LOCALE + 1);
|
||||||
FemaleText.resize(DEFAULT_LOCALE + 1);
|
FemaleText.resize(DEFAULT_LOCALE + 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
uint32 Id;
|
uint32 Id{0};
|
||||||
uint32 Language;
|
uint32 Language{0};
|
||||||
StringVector MaleText;
|
StringVector MaleText;
|
||||||
StringVector FemaleText;
|
StringVector FemaleText;
|
||||||
uint32 EmoteId0;
|
uint32 EmoteId0{0};
|
||||||
uint32 EmoteId1;
|
uint32 EmoteId1{0};
|
||||||
uint32 EmoteId2;
|
uint32 EmoteId2{0};
|
||||||
uint32 EmoteDelay0;
|
uint32 EmoteDelay0{0};
|
||||||
uint32 EmoteDelay1;
|
uint32 EmoteDelay1{0};
|
||||||
uint32 EmoteDelay2;
|
uint32 EmoteDelay2{0};
|
||||||
uint32 SoundId;
|
uint32 SoundId{0};
|
||||||
uint32 Unk1;
|
uint32 Unk1{0};
|
||||||
uint32 Unk2;
|
uint32 Unk2{0};
|
||||||
// uint32 VerifiedBuild;
|
// uint32 VerifiedBuild;
|
||||||
|
|
||||||
[[nodiscard]] std::string const& GetText(LocaleConstant locale = DEFAULT_LOCALE, uint8 gender = GENDER_MALE, bool forceGender = false) const
|
[[nodiscard]] std::string const& GetText(LocaleConstant locale = DEFAULT_LOCALE, uint8 gender = GENDER_MALE, bool forceGender = false) const
|
||||||
@@ -511,24 +510,24 @@ typedef std::pair<QuestRelations::const_iterator, QuestRelations::const_iterator
|
|||||||
|
|
||||||
struct PetLevelInfo
|
struct PetLevelInfo
|
||||||
{
|
{
|
||||||
PetLevelInfo() : health(0), mana(0), armor(0), min_dmg(0), max_dmg(0) { for (unsigned short & stat : stats) stat = 0; }
|
PetLevelInfo() { for (unsigned short & stat : stats) stat = 0; }
|
||||||
|
|
||||||
uint16 stats[MAX_STATS];
|
uint16 stats[MAX_STATS];
|
||||||
uint16 health;
|
uint16 health{0};
|
||||||
uint16 mana;
|
uint16 mana{0};
|
||||||
uint32 armor;
|
uint32 armor{0};
|
||||||
uint16 min_dmg;
|
uint16 min_dmg{0};
|
||||||
uint16 max_dmg;
|
uint16 max_dmg{0};
|
||||||
};
|
};
|
||||||
|
|
||||||
struct MailLevelReward
|
struct MailLevelReward
|
||||||
{
|
{
|
||||||
MailLevelReward() : raceMask(0), mailTemplateId(0), senderEntry(0) {}
|
MailLevelReward() {}
|
||||||
MailLevelReward(uint32 _raceMask, uint32 _mailTemplateId, uint32 _senderEntry) : raceMask(_raceMask), mailTemplateId(_mailTemplateId), senderEntry(_senderEntry) {}
|
MailLevelReward(uint32 _raceMask, uint32 _mailTemplateId, uint32 _senderEntry) : raceMask(_raceMask), mailTemplateId(_mailTemplateId), senderEntry(_senderEntry) {}
|
||||||
|
|
||||||
uint32 raceMask;
|
uint32 raceMask{0};
|
||||||
uint32 mailTemplateId;
|
uint32 mailTemplateId{0};
|
||||||
uint32 senderEntry;
|
uint32 senderEntry{0};
|
||||||
};
|
};
|
||||||
|
|
||||||
typedef std::list<MailLevelReward> MailLevelRewardList;
|
typedef std::list<MailLevelReward> MailLevelRewardList;
|
||||||
@@ -611,25 +610,25 @@ typedef std::pair<GossipMenuItemsContainer::iterator, GossipMenuItemsContainer::
|
|||||||
|
|
||||||
struct QuestPOIPoint
|
struct QuestPOIPoint
|
||||||
{
|
{
|
||||||
int32 x;
|
int32 x{0};
|
||||||
int32 y;
|
int32 y{0};
|
||||||
|
|
||||||
QuestPOIPoint() : x(0), y(0) {}
|
QuestPOIPoint() {}
|
||||||
QuestPOIPoint(int32 _x, int32 _y) : x(_x), y(_y) {}
|
QuestPOIPoint(int32 _x, int32 _y) : x(_x), y(_y) {}
|
||||||
};
|
};
|
||||||
|
|
||||||
struct QuestPOI
|
struct QuestPOI
|
||||||
{
|
{
|
||||||
uint32 Id;
|
uint32 Id{0};
|
||||||
int32 ObjectiveIndex;
|
int32 ObjectiveIndex{0};
|
||||||
uint32 MapId;
|
uint32 MapId{0};
|
||||||
uint32 AreaId;
|
uint32 AreaId{0};
|
||||||
uint32 FloorId;
|
uint32 FloorId{0};
|
||||||
uint32 Unk3;
|
uint32 Unk3{0};
|
||||||
uint32 Unk4;
|
uint32 Unk4{0};
|
||||||
std::vector<QuestPOIPoint> points;
|
std::vector<QuestPOIPoint> points;
|
||||||
|
|
||||||
QuestPOI() : Id(0), ObjectiveIndex(0), MapId(0), AreaId(0), FloorId(0), Unk3(0), Unk4(0) {}
|
QuestPOI() {}
|
||||||
QuestPOI(uint32 id, int32 objIndex, uint32 mapId, uint32 areaId, uint32 floorId, uint32 unk3, uint32 unk4) : Id(id), ObjectiveIndex(objIndex), MapId(mapId), AreaId(areaId), FloorId(floorId), Unk3(unk3), Unk4(unk4) {}
|
QuestPOI(uint32 id, int32 objIndex, uint32 mapId, uint32 areaId, uint32 floorId, uint32 unk3, uint32 unk4) : Id(id), ObjectiveIndex(objIndex), MapId(mapId), AreaId(areaId), FloorId(floorId), Unk3(unk3), Unk4(unk4) {}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -15,12 +15,12 @@ class Player;
|
|||||||
class GroupReference : public Reference<Group, Player>
|
class GroupReference : public Reference<Group, Player>
|
||||||
{
|
{
|
||||||
protected:
|
protected:
|
||||||
uint8 iSubGroup;
|
uint8 iSubGroup{0};
|
||||||
void targetObjectBuildLink() override;
|
void targetObjectBuildLink() override;
|
||||||
void targetObjectDestroyLink() override;
|
void targetObjectDestroyLink() override;
|
||||||
void sourceObjectDestroyLink() override;
|
void sourceObjectDestroyLink() override;
|
||||||
public:
|
public:
|
||||||
GroupReference() : Reference<Group, Player>(), iSubGroup(0) {}
|
GroupReference() : Reference<Group, Player>() {}
|
||||||
~GroupReference() override { unlink(); }
|
~GroupReference() override { unlink(); }
|
||||||
GroupReference* next() { return (GroupReference*)Reference<Group, Player>::next(); }
|
GroupReference* next() { return (GroupReference*)Reference<Group, Player>::next(); }
|
||||||
[[nodiscard]] GroupReference const* next() const { return (GroupReference const*)Reference<Group, Player>::next(); }
|
[[nodiscard]] GroupReference const* next() const { return (GroupReference const*)Reference<Group, Player>::next(); }
|
||||||
|
|||||||
@@ -27,10 +27,10 @@ class InstanceSave;
|
|||||||
|
|
||||||
struct InstancePlayerBind
|
struct InstancePlayerBind
|
||||||
{
|
{
|
||||||
InstanceSave* save;
|
InstanceSave* save{nullptr};
|
||||||
bool perm : 1;
|
bool perm : 1;
|
||||||
bool extended : 1;
|
bool extended : 1;
|
||||||
InstancePlayerBind() : save(nullptr), perm(false), extended(false) {}
|
InstancePlayerBind() : perm(false), extended(false) {}
|
||||||
};
|
};
|
||||||
|
|
||||||
typedef std::unordered_map< uint32 /*mapId*/, InstancePlayerBind > BoundInstancesMap;
|
typedef std::unordered_map< uint32 /*mapId*/, InstancePlayerBind > BoundInstancesMap;
|
||||||
@@ -101,7 +101,7 @@ class InstanceSaveManager
|
|||||||
friend class InstanceSave;
|
friend class InstanceSave;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
InstanceSaveManager() : lock_instLists(false) {};
|
InstanceSaveManager() {};
|
||||||
~InstanceSaveManager();
|
~InstanceSaveManager();
|
||||||
|
|
||||||
public:
|
public:
|
||||||
@@ -111,11 +111,11 @@ public:
|
|||||||
|
|
||||||
struct InstResetEvent
|
struct InstResetEvent
|
||||||
{
|
{
|
||||||
uint8 type; // 0 - unused, 1-4 warnings about pending reset, 5 - reset
|
uint8 type{0}; // 0 - unused, 1-4 warnings about pending reset, 5 - reset
|
||||||
Difficulty difficulty: 8;
|
Difficulty difficulty: 8;
|
||||||
uint16 mapid;
|
uint16 mapid{0};
|
||||||
|
|
||||||
InstResetEvent() : type(0), difficulty(DUNGEON_DIFFICULTY_NORMAL), mapid(0) {}
|
InstResetEvent() : difficulty(DUNGEON_DIFFICULTY_NORMAL) {}
|
||||||
InstResetEvent(uint8 t, uint32 _mapid, Difficulty d)
|
InstResetEvent(uint8 t, uint32 _mapid, Difficulty d)
|
||||||
: type(t), difficulty(d), mapid(_mapid) {}
|
: type(t), difficulty(d), mapid(_mapid) {}
|
||||||
};
|
};
|
||||||
@@ -183,7 +183,7 @@ protected:
|
|||||||
private:
|
private:
|
||||||
void _ResetOrWarnAll(uint32 mapid, Difficulty difficulty, bool warn, time_t resetTime);
|
void _ResetOrWarnAll(uint32 mapid, Difficulty difficulty, bool warn, time_t resetTime);
|
||||||
void _ResetSave(InstanceSaveHashMap::iterator& itr);
|
void _ResetSave(InstanceSaveHashMap::iterator& itr);
|
||||||
bool lock_instLists;
|
bool lock_instLists{false};
|
||||||
InstanceSaveHashMap m_instanceSaveById;
|
InstanceSaveHashMap m_instanceSaveById;
|
||||||
ResetTimeByMapDifficultyMap m_resetTimeByMapDifficulty;
|
ResetTimeByMapDifficultyMap m_resetTimeByMapDifficulty;
|
||||||
ResetTimeByMapDifficultyMap m_resetExtendedTimeByMapDifficulty;
|
ResetTimeByMapDifficultyMap m_resetExtendedTimeByMapDifficulty;
|
||||||
|
|||||||
@@ -170,11 +170,11 @@ struct LootItem
|
|||||||
|
|
||||||
struct QuestItem
|
struct QuestItem
|
||||||
{
|
{
|
||||||
uint8 index; // position in quest_items;
|
uint8 index{0}; // position in quest_items;
|
||||||
bool is_looted;
|
bool is_looted{false};
|
||||||
|
|
||||||
QuestItem()
|
QuestItem()
|
||||||
: index(0), is_looted(false) {}
|
{}
|
||||||
|
|
||||||
QuestItem(uint8 _index, bool _islooted = false)
|
QuestItem(uint8 _index, bool _islooted = false)
|
||||||
: index(_index), is_looted(_islooted) {}
|
: index(_index), is_looted(_islooted) {}
|
||||||
@@ -306,14 +306,14 @@ struct Loot
|
|||||||
std::vector<LootItem> items;
|
std::vector<LootItem> items;
|
||||||
std::vector<LootItem> quest_items;
|
std::vector<LootItem> quest_items;
|
||||||
uint32 gold;
|
uint32 gold;
|
||||||
uint8 unlootedCount;
|
uint8 unlootedCount{0};
|
||||||
uint64 roundRobinPlayer; // GUID of the player having the Round-Robin ownership for the loot. If 0, round robin owner has released.
|
uint64 roundRobinPlayer{0}; // GUID of the player having the Round-Robin ownership for the loot. If 0, round robin owner has released.
|
||||||
LootType loot_type; // required for achievement system
|
LootType loot_type{LOOT_NONE}; // required for achievement system
|
||||||
|
|
||||||
// GUIDLow of container that holds this loot (item_instance.entry), set for items that can be looted
|
// GUIDLow of container that holds this loot (item_instance.entry), set for items that can be looted
|
||||||
uint32 containerId;
|
uint32 containerId{0};
|
||||||
|
|
||||||
Loot(uint32 _gold = 0) : gold(_gold), unlootedCount(0), roundRobinPlayer(0), loot_type(LOOT_NONE), containerId(0) { }
|
Loot(uint32 _gold = 0) : gold(_gold) { }
|
||||||
~Loot() { clear(); }
|
~Loot() { clear(); }
|
||||||
|
|
||||||
// if loot becomes invalid this reference is used to inform the listener
|
// if loot becomes invalid this reference is used to inform the listener
|
||||||
|
|||||||
@@ -237,14 +237,13 @@ enum LevelRequirementVsMode
|
|||||||
|
|
||||||
struct ZoneDynamicInfo
|
struct ZoneDynamicInfo
|
||||||
{
|
{
|
||||||
ZoneDynamicInfo() : MusicId(0), WeatherId(0), WeatherGrade(0.0f),
|
ZoneDynamicInfo() { }
|
||||||
OverrideLightId(0), LightFadeInTime(0) { }
|
|
||||||
|
|
||||||
uint32 MusicId;
|
uint32 MusicId{0};
|
||||||
uint32 WeatherId;
|
uint32 WeatherId{0};
|
||||||
float WeatherGrade;
|
float WeatherGrade{0.0f};
|
||||||
uint32 OverrideLightId;
|
uint32 OverrideLightId{0};
|
||||||
uint32 LightFadeInTime;
|
uint32 LightFadeInTime{0};
|
||||||
};
|
};
|
||||||
|
|
||||||
#if defined(__GNUC__)
|
#if defined(__GNUC__)
|
||||||
|
|||||||
@@ -3569,15 +3569,14 @@ enum PartyResult
|
|||||||
|
|
||||||
struct MmapTileHeader
|
struct MmapTileHeader
|
||||||
{
|
{
|
||||||
uint32 mmapMagic;
|
uint32 mmapMagic{MMAP_MAGIC};
|
||||||
uint32 dtVersion;
|
uint32 dtVersion;
|
||||||
uint32 mmapVersion;
|
uint32 mmapVersion{MMAP_VERSION};
|
||||||
uint32 size;
|
uint32 size{0};
|
||||||
char usesLiquids;
|
char usesLiquids{true};
|
||||||
char padding[3];
|
char padding[3]{};
|
||||||
|
|
||||||
MmapTileHeader() : mmapMagic(MMAP_MAGIC), dtVersion(DT_NAVMESH_VERSION),
|
MmapTileHeader() : dtVersion(DT_NAVMESH_VERSION) { }
|
||||||
mmapVersion(MMAP_VERSION), size(0), usesLiquids(true), padding() { }
|
|
||||||
};
|
};
|
||||||
|
|
||||||
// All padding fields must be handled and initialized to ensure mmaps_generator will produce binary-identical *.mmtile files
|
// All padding fields must be handled and initialized to ensure mmaps_generator will produce binary-identical *.mmtile files
|
||||||
|
|||||||
@@ -14,12 +14,12 @@ namespace Movement
|
|||||||
{
|
{
|
||||||
struct Location : public Vector3
|
struct Location : public Vector3
|
||||||
{
|
{
|
||||||
Location() : orientation(0) {}
|
Location() {}
|
||||||
Location(float x, float y, float z, float o) : Vector3(x, y, z), orientation(o) {}
|
Location(float x, float y, float z, float o) : Vector3(x, y, z), orientation(o) {}
|
||||||
Location(const Vector3& v) : Vector3(v), orientation(0) {}
|
Location(const Vector3& v) : Vector3(v), orientation(0) {}
|
||||||
Location(const Vector3& v, float o) : Vector3(v), orientation(o) {}
|
Location(const Vector3& v, float o) : Vector3(v), orientation(o) {}
|
||||||
|
|
||||||
float orientation;
|
float orientation{0};
|
||||||
};
|
};
|
||||||
|
|
||||||
// MoveSpline represents smooth catmullrom or linear curve and point that moves belong it
|
// MoveSpline represents smooth catmullrom or linear curve and point that moves belong it
|
||||||
|
|||||||
@@ -32,9 +32,7 @@ namespace Movement
|
|||||||
|
|
||||||
struct MoveSplineInitArgs
|
struct MoveSplineInitArgs
|
||||||
{
|
{
|
||||||
MoveSplineInitArgs(size_t path_capacity = 16) : path_Idx_offset(0), velocity(0.f),
|
MoveSplineInitArgs(size_t path_capacity = 16)
|
||||||
parabolic_amplitude(0.f), time_perc(0.f), splineId(0), initialOrientation(0.f),
|
|
||||||
HasVelocity(false), TransformForTransport(true)
|
|
||||||
{
|
{
|
||||||
path.reserve(path_capacity);
|
path.reserve(path_capacity);
|
||||||
}
|
}
|
||||||
@@ -42,14 +40,14 @@ namespace Movement
|
|||||||
PointsArray path;
|
PointsArray path;
|
||||||
FacingInfo facing;
|
FacingInfo facing;
|
||||||
MoveSplineFlag flags;
|
MoveSplineFlag flags;
|
||||||
int32 path_Idx_offset;
|
int32 path_Idx_offset{0};
|
||||||
float velocity;
|
float velocity{0.f};
|
||||||
float parabolic_amplitude;
|
float parabolic_amplitude{0.f};
|
||||||
float time_perc;
|
float time_perc{0.f};
|
||||||
uint32 splineId;
|
uint32 splineId{0};
|
||||||
float initialOrientation;
|
float initialOrientation{0.f};
|
||||||
bool HasVelocity;
|
bool HasVelocity{false};
|
||||||
bool TransformForTransport;
|
bool TransformForTransport{true};
|
||||||
|
|
||||||
/** Returns true to show that the arguments were configured correctly and MoveSpline initialization will succeed. */
|
/** Returns true to show that the arguments were configured correctly and MoveSpline initialization will succeed. */
|
||||||
bool Validate(Unit* unit) const;
|
bool Validate(Unit* unit) const;
|
||||||
|
|||||||
@@ -33,11 +33,11 @@ namespace Movement
|
|||||||
ControlArray points;
|
ControlArray points;
|
||||||
ControlArray pointsVisual;
|
ControlArray pointsVisual;
|
||||||
|
|
||||||
index_type index_lo;
|
index_type index_lo{0};
|
||||||
index_type index_hi;
|
index_type index_hi{0};
|
||||||
|
|
||||||
uint8 m_mode;
|
uint8 m_mode{UninitializedMode};
|
||||||
bool cyclic;
|
bool cyclic{false};
|
||||||
|
|
||||||
enum
|
enum
|
||||||
{
|
{
|
||||||
@@ -79,7 +79,7 @@ namespace Movement
|
|||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
explicit SplineBase() : index_lo(0), index_hi(0), m_mode(UninitializedMode), cyclic(false) {}
|
explicit SplineBase() {}
|
||||||
|
|
||||||
/** Caclulates the position for given segment Idx, and percent of segment length t
|
/** Caclulates the position for given segment Idx, and percent of segment length t
|
||||||
@param t - percent of segment length, assumes that t in range [0, 1]
|
@param t - percent of segment length, assumes that t in range [0, 1]
|
||||||
|
|||||||
@@ -388,17 +388,17 @@ protected:
|
|||||||
|
|
||||||
struct QuestStatusData
|
struct QuestStatusData
|
||||||
{
|
{
|
||||||
QuestStatusData(): Status(QUEST_STATUS_NONE), Timer(0), PlayerCount(0), Explored(false)
|
QuestStatusData()
|
||||||
{
|
{
|
||||||
memset(ItemCount, 0, QUEST_ITEM_OBJECTIVES_COUNT * sizeof(uint16));
|
memset(ItemCount, 0, QUEST_ITEM_OBJECTIVES_COUNT * sizeof(uint16));
|
||||||
memset(CreatureOrGOCount, 0, QUEST_OBJECTIVES_COUNT * sizeof(uint16));
|
memset(CreatureOrGOCount, 0, QUEST_OBJECTIVES_COUNT * sizeof(uint16));
|
||||||
}
|
}
|
||||||
|
|
||||||
QuestStatus Status;
|
QuestStatus Status{QUEST_STATUS_NONE};
|
||||||
uint32 Timer;
|
uint32 Timer{0};
|
||||||
uint16 ItemCount[QUEST_ITEM_OBJECTIVES_COUNT];
|
uint16 ItemCount[QUEST_ITEM_OBJECTIVES_COUNT];
|
||||||
uint16 CreatureOrGOCount[QUEST_OBJECTIVES_COUNT];
|
uint16 CreatureOrGOCount[QUEST_OBJECTIVES_COUNT];
|
||||||
uint16 PlayerCount;
|
uint16 PlayerCount{0};
|
||||||
bool Explored;
|
bool Explored{false};
|
||||||
};
|
};
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -75,9 +75,9 @@ enum AccountDataType
|
|||||||
|
|
||||||
struct AccountData
|
struct AccountData
|
||||||
{
|
{
|
||||||
AccountData() : Time(0), Data("") {}
|
AccountData() : Data("") {}
|
||||||
|
|
||||||
time_t Time;
|
time_t Time{0};
|
||||||
std::string Data;
|
std::string Data;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -444,7 +444,7 @@ private:
|
|||||||
typedef std::unordered_map<uint32, uint32> PetAuraMap;
|
typedef std::unordered_map<uint32, uint32> PetAuraMap;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
PetAura() : removeOnChangePet(false), damage(0)
|
PetAura()
|
||||||
{
|
{
|
||||||
auras.clear();
|
auras.clear();
|
||||||
}
|
}
|
||||||
@@ -483,8 +483,8 @@ public:
|
|||||||
|
|
||||||
private:
|
private:
|
||||||
PetAuraMap auras;
|
PetAuraMap auras;
|
||||||
bool removeOnChangePet;
|
bool removeOnChangePet{false};
|
||||||
int32 damage;
|
int32 damage{0};
|
||||||
};
|
};
|
||||||
typedef std::map<uint32, PetAura> SpellPetAuraMap;
|
typedef std::map<uint32, PetAura> SpellPetAuraMap;
|
||||||
|
|
||||||
|
|||||||
@@ -14,7 +14,7 @@ template <class T>
|
|||||||
class DBCStorageIterator : public std::iterator<std::forward_iterator_tag, T>
|
class DBCStorageIterator : public std::iterator<std::forward_iterator_tag, T>
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
DBCStorageIterator() : _index(nullptr), _pos(0), _end(0) { }
|
DBCStorageIterator() : _index(nullptr) { }
|
||||||
DBCStorageIterator(T** index, uint32 size, uint32 pos = 0) : _index(index), _pos(pos), _end(size)
|
DBCStorageIterator(T** index, uint32 size, uint32 pos = 0) : _index(index), _pos(pos), _end(size)
|
||||||
{
|
{
|
||||||
if (_pos < _end)
|
if (_pos < _end)
|
||||||
@@ -51,8 +51,8 @@ public:
|
|||||||
|
|
||||||
private:
|
private:
|
||||||
T** _index;
|
T** _index;
|
||||||
uint32 _pos;
|
uint32 _pos{0};
|
||||||
uint32 _end;
|
uint32 _end{0};
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // DBCStorageIterator_h__
|
#endif // DBCStorageIterator_h__
|
||||||
|
|||||||
@@ -2093,32 +2093,32 @@ struct WorldStateUI
|
|||||||
// Structures not used for casting to loaded DBC data and not required then packing
|
// Structures not used for casting to loaded DBC data and not required then packing
|
||||||
struct MapDifficulty
|
struct MapDifficulty
|
||||||
{
|
{
|
||||||
MapDifficulty() : resetTime(0), maxPlayers(0), hasErrorMessage(false) {}
|
MapDifficulty() {}
|
||||||
MapDifficulty(uint32 _resetTime, uint32 _maxPlayers, bool _hasErrorMessage) : resetTime(_resetTime), maxPlayers(_maxPlayers), hasErrorMessage(_hasErrorMessage) {}
|
MapDifficulty(uint32 _resetTime, uint32 _maxPlayers, bool _hasErrorMessage) : resetTime(_resetTime), maxPlayers(_maxPlayers), hasErrorMessage(_hasErrorMessage) {}
|
||||||
|
|
||||||
uint32 resetTime;
|
uint32 resetTime{0};
|
||||||
uint32 maxPlayers;
|
uint32 maxPlayers{0};
|
||||||
bool hasErrorMessage;
|
bool hasErrorMessage{false};
|
||||||
};
|
};
|
||||||
|
|
||||||
struct TalentSpellPos
|
struct TalentSpellPos
|
||||||
{
|
{
|
||||||
TalentSpellPos() : talent_id(0), rank(0) {}
|
TalentSpellPos() {}
|
||||||
TalentSpellPos(uint16 _talent_id, uint8 _rank) : talent_id(_talent_id), rank(_rank) {}
|
TalentSpellPos(uint16 _talent_id, uint8 _rank) : talent_id(_talent_id), rank(_rank) {}
|
||||||
|
|
||||||
uint16 talent_id;
|
uint16 talent_id{0};
|
||||||
uint8 rank;
|
uint8 rank{0};
|
||||||
};
|
};
|
||||||
|
|
||||||
typedef std::map<uint32, TalentSpellPos> TalentSpellPosMap;
|
typedef std::map<uint32, TalentSpellPos> TalentSpellPosMap;
|
||||||
|
|
||||||
struct TaxiPathBySourceAndDestination
|
struct TaxiPathBySourceAndDestination
|
||||||
{
|
{
|
||||||
TaxiPathBySourceAndDestination() : ID(0), price(0) {}
|
TaxiPathBySourceAndDestination() {}
|
||||||
TaxiPathBySourceAndDestination(uint32 _id, uint32 _price) : ID(_id), price(_price) {}
|
TaxiPathBySourceAndDestination(uint32 _id, uint32 _price) : ID(_id), price(_price) {}
|
||||||
|
|
||||||
uint32 ID;
|
uint32 ID{0};
|
||||||
uint32 price;
|
uint32 price{0};
|
||||||
};
|
};
|
||||||
typedef std::map<uint32, TaxiPathBySourceAndDestination> TaxiPathSetForSource;
|
typedef std::map<uint32, TaxiPathBySourceAndDestination> TaxiPathSetForSource;
|
||||||
typedef std::map<uint32, TaxiPathSetForSource> TaxiPathSetBySource;
|
typedef std::map<uint32, TaxiPathSetForSource> TaxiPathSetBySource;
|
||||||
|
|||||||
@@ -17,8 +17,8 @@ RealmSocket::Session::Session() = default;
|
|||||||
RealmSocket::Session::~Session() = default;
|
RealmSocket::Session::~Session() = default;
|
||||||
|
|
||||||
RealmSocket::RealmSocket() :
|
RealmSocket::RealmSocket() :
|
||||||
input_buffer_(4096), session_(nullptr),
|
input_buffer_(4096),
|
||||||
_remoteAddress(), _remotePort(0)
|
_remoteAddress()
|
||||||
{
|
{
|
||||||
reference_counting_policy().value(ACE_Event_Handler::Reference_Counting_Policy::ENABLED);
|
reference_counting_policy().value(ACE_Event_Handler::Reference_Counting_Policy::ENABLED);
|
||||||
|
|
||||||
|
|||||||
@@ -59,9 +59,9 @@ private:
|
|||||||
ssize_t noblk_send(ACE_Message_Block& message_block);
|
ssize_t noblk_send(ACE_Message_Block& message_block);
|
||||||
|
|
||||||
ACE_Message_Block input_buffer_;
|
ACE_Message_Block input_buffer_;
|
||||||
Session* session_;
|
Session* session_{nullptr};
|
||||||
std::string _remoteAddress;
|
std::string _remoteAddress;
|
||||||
uint16 _remotePort;
|
uint16 _remotePort{0};
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif /* __REALMSOCKET_H__ */
|
#endif /* __REALMSOCKET_H__ */
|
||||||
|
|||||||
@@ -8,7 +8,7 @@
|
|||||||
#include "RealmList.h"
|
#include "RealmList.h"
|
||||||
#include "DatabaseEnv.h"
|
#include "DatabaseEnv.h"
|
||||||
|
|
||||||
RealmList::RealmList() : m_UpdateInterval(0), m_NextUpdateTime(time(nullptr)) { }
|
RealmList::RealmList() : m_NextUpdateTime(time(nullptr)) { }
|
||||||
|
|
||||||
RealmList* RealmList::instance()
|
RealmList* RealmList::instance()
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -63,7 +63,7 @@ private:
|
|||||||
void UpdateRealm(uint32 id, const std::string& name, ACE_INET_Addr const& address, ACE_INET_Addr const& localAddr, ACE_INET_Addr const& localSubmask, uint8 icon, RealmFlags flag, uint8 timezone, AccountTypes allowedSecurityLevel, float popu, uint32 build);
|
void UpdateRealm(uint32 id, const std::string& name, ACE_INET_Addr const& address, ACE_INET_Addr const& localAddr, ACE_INET_Addr const& localSubmask, uint8 icon, RealmFlags flag, uint8 timezone, AccountTypes allowedSecurityLevel, float popu, uint32 build);
|
||||||
|
|
||||||
RealmMap m_realms;
|
RealmMap m_realms;
|
||||||
uint32 m_UpdateInterval;
|
uint32 m_UpdateInterval{0};
|
||||||
time_t m_NextUpdateTime;
|
time_t m_NextUpdateTime;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -17,14 +17,13 @@ namespace MMAP
|
|||||||
// this class gathers all debug info holding and output
|
// this class gathers all debug info holding and output
|
||||||
struct IntermediateValues
|
struct IntermediateValues
|
||||||
{
|
{
|
||||||
rcHeightfield* heightfield;
|
rcHeightfield* heightfield{nullptr};
|
||||||
rcCompactHeightfield* compactHeightfield;
|
rcCompactHeightfield* compactHeightfield{nullptr};
|
||||||
rcContourSet* contours;
|
rcContourSet* contours{nullptr};
|
||||||
rcPolyMesh* polyMesh;
|
rcPolyMesh* polyMesh{nullptr};
|
||||||
rcPolyMeshDetail* polyMeshDetail;
|
rcPolyMeshDetail* polyMeshDetail{nullptr};
|
||||||
|
|
||||||
IntermediateValues() : heightfield(nullptr), compactHeightfield(nullptr),
|
IntermediateValues() {}
|
||||||
contours(nullptr), polyMesh(nullptr), polyMeshDetail(nullptr) {}
|
|
||||||
~IntermediateValues();
|
~IntermediateValues();
|
||||||
|
|
||||||
void writeIV(uint32 mapID, uint32 tileX, uint32 tileY);
|
void writeIV(uint32 mapID, uint32 tileX, uint32 tileY);
|
||||||
|
|||||||
@@ -25,15 +25,14 @@ namespace DisableMgr
|
|||||||
|
|
||||||
struct MmapTileHeader
|
struct MmapTileHeader
|
||||||
{
|
{
|
||||||
uint32 mmapMagic;
|
uint32 mmapMagic{MMAP_MAGIC};
|
||||||
uint32 dtVersion;
|
uint32 dtVersion;
|
||||||
uint32 mmapVersion;
|
uint32 mmapVersion{MMAP_VERSION};
|
||||||
uint32 size;
|
uint32 size{0};
|
||||||
char usesLiquids;
|
char usesLiquids{true};
|
||||||
char padding[3];
|
char padding[3]{};
|
||||||
|
|
||||||
MmapTileHeader() : mmapMagic(MMAP_MAGIC), dtVersion(DT_NAVMESH_VERSION),
|
MmapTileHeader() : dtVersion(DT_NAVMESH_VERSION) {}
|
||||||
mmapVersion(MMAP_VERSION), size(0), usesLiquids(true), padding() {}
|
|
||||||
};
|
};
|
||||||
|
|
||||||
// All padding fields must be handled and initialized to ensure mmaps_generator will produce binary-identical *.mmtile files
|
// All padding fields must be handled and initialized to ensure mmaps_generator will produce binary-identical *.mmtile files
|
||||||
@@ -50,7 +49,7 @@ namespace MMAP
|
|||||||
MapBuilder::MapBuilder(float maxWalkableAngle, bool skipLiquid,
|
MapBuilder::MapBuilder(float maxWalkableAngle, bool skipLiquid,
|
||||||
bool skipContinents, bool skipJunkMaps, bool skipBattlegrounds,
|
bool skipContinents, bool skipJunkMaps, bool skipBattlegrounds,
|
||||||
bool debugOutput, bool bigBaseUnit, const char* offMeshFilePath) :
|
bool debugOutput, bool bigBaseUnit, const char* offMeshFilePath) :
|
||||||
m_terrainBuilder (nullptr),
|
|
||||||
m_debugOutput (debugOutput),
|
m_debugOutput (debugOutput),
|
||||||
m_offMeshFilePath (offMeshFilePath),
|
m_offMeshFilePath (offMeshFilePath),
|
||||||
m_skipContinents (skipContinents),
|
m_skipContinents (skipContinents),
|
||||||
@@ -58,7 +57,7 @@ namespace MMAP
|
|||||||
m_skipBattlegrounds (skipBattlegrounds),
|
m_skipBattlegrounds (skipBattlegrounds),
|
||||||
m_maxWalkableAngle (maxWalkableAngle),
|
m_maxWalkableAngle (maxWalkableAngle),
|
||||||
m_bigBaseUnit (bigBaseUnit),
|
m_bigBaseUnit (bigBaseUnit),
|
||||||
m_rcContext (nullptr),
|
|
||||||
_cancelationToken (false)
|
_cancelationToken (false)
|
||||||
{
|
{
|
||||||
m_terrainBuilder = new TerrainBuilder(skipLiquid);
|
m_terrainBuilder = new TerrainBuilder(skipLiquid);
|
||||||
|
|||||||
@@ -27,13 +27,13 @@ namespace MMAP
|
|||||||
{
|
{
|
||||||
struct MapTiles
|
struct MapTiles
|
||||||
{
|
{
|
||||||
MapTiles() : m_mapId(uint32(-1)), m_tiles(nullptr) {}
|
MapTiles() : m_mapId(uint32(-1)) {}
|
||||||
|
|
||||||
MapTiles(uint32 id, std::set<uint32>* tiles) : m_mapId(id), m_tiles(tiles) {}
|
MapTiles(uint32 id, std::set<uint32>* tiles) : m_mapId(id), m_tiles(tiles) {}
|
||||||
~MapTiles() = default;
|
~MapTiles() = default;
|
||||||
|
|
||||||
uint32 m_mapId;
|
uint32 m_mapId;
|
||||||
std::set<uint32>* m_tiles;
|
std::set<uint32>* m_tiles{nullptr};
|
||||||
|
|
||||||
bool operator==(uint32 id)
|
bool operator==(uint32 id)
|
||||||
{
|
{
|
||||||
@@ -45,7 +45,7 @@ namespace MMAP
|
|||||||
|
|
||||||
struct Tile
|
struct Tile
|
||||||
{
|
{
|
||||||
Tile() : chf(nullptr), solid(nullptr), cset(nullptr), pmesh(nullptr), dmesh(nullptr) {}
|
Tile() {}
|
||||||
~Tile()
|
~Tile()
|
||||||
{
|
{
|
||||||
rcFreeCompactHeightfield(chf);
|
rcFreeCompactHeightfield(chf);
|
||||||
@@ -54,11 +54,11 @@ namespace MMAP
|
|||||||
rcFreePolyMesh(pmesh);
|
rcFreePolyMesh(pmesh);
|
||||||
rcFreePolyMeshDetail(dmesh);
|
rcFreePolyMeshDetail(dmesh);
|
||||||
}
|
}
|
||||||
rcCompactHeightfield* chf;
|
rcCompactHeightfield* chf{nullptr};
|
||||||
rcHeightfield* solid;
|
rcHeightfield* solid{nullptr};
|
||||||
rcContourSet* cset;
|
rcContourSet* cset{nullptr};
|
||||||
rcPolyMesh* pmesh;
|
rcPolyMesh* pmesh{nullptr};
|
||||||
rcPolyMeshDetail* dmesh;
|
rcPolyMeshDetail* dmesh{nullptr};
|
||||||
};
|
};
|
||||||
|
|
||||||
class MapBuilder
|
class MapBuilder
|
||||||
@@ -116,7 +116,7 @@ namespace MMAP
|
|||||||
// percentageDone - method to calculate percentage
|
// percentageDone - method to calculate percentage
|
||||||
uint32 percentageDone(uint32 totalTiles, uint32 totalTilesDone);
|
uint32 percentageDone(uint32 totalTiles, uint32 totalTilesDone);
|
||||||
|
|
||||||
TerrainBuilder* m_terrainBuilder;
|
TerrainBuilder* m_terrainBuilder{nullptr};
|
||||||
TileList m_tiles;
|
TileList m_tiles;
|
||||||
|
|
||||||
bool m_debugOutput;
|
bool m_debugOutput;
|
||||||
@@ -133,7 +133,7 @@ namespace MMAP
|
|||||||
std::atomic<uint32> m_totalTilesBuilt;
|
std::atomic<uint32> m_totalTilesBuilt;
|
||||||
|
|
||||||
// build performance - not really used for now
|
// build performance - not really used for now
|
||||||
rcContext* m_rcContext;
|
rcContext* m_rcContext{nullptr};
|
||||||
|
|
||||||
std::vector<std::thread> _workerThreads;
|
std::vector<std::thread> _workerThreads;
|
||||||
ProducerConsumerQueue<uint32> _queue;
|
ProducerConsumerQueue<uint32> _queue;
|
||||||
|
|||||||
@@ -42,12 +42,12 @@ public:
|
|||||||
class ModelInstance
|
class ModelInstance
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
uint32 id;
|
uint32 id{0};
|
||||||
Vec3D pos, rot;
|
Vec3D pos, rot;
|
||||||
uint16 scale, flags;
|
uint16 scale{0}, flags{0};
|
||||||
float sc;
|
float sc{0.0f};
|
||||||
|
|
||||||
ModelInstance() : id(0), scale(0), flags(0), sc(0.0f) {}
|
ModelInstance() {}
|
||||||
ModelInstance(MPQFile& f, char const* ModelInstName, uint32 mapID, uint32 tileX, uint32 tileY, FILE* pDirfile);
|
ModelInstance(MPQFile& f, char const* ModelInstName, uint32 mapID, uint32 tileX, uint32 tileY, FILE* pDirfile);
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user