refactor(Core): apply clang-tidy modernize-use-nullptr (#3819)
This commit is contained in:
@@ -52,7 +52,7 @@ namespace VMAP
|
|||||||
class ManagedModel
|
class ManagedModel
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
ManagedModel() : iModel(0), iRefCount(0) { }
|
ManagedModel() : iModel(nullptr), iRefCount(0) { }
|
||||||
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; }
|
||||||
|
|||||||
@@ -19,7 +19,7 @@ namespace VMAP
|
|||||||
|
|
||||||
struct LocationInfo
|
struct LocationInfo
|
||||||
{
|
{
|
||||||
LocationInfo(): hitInstance(0), hitModel(0), ground_Z(-G3D::inf()) { }
|
LocationInfo(): hitInstance(nullptr), hitModel(nullptr), ground_Z(-G3D::inf()) { }
|
||||||
const ModelInstance* hitInstance;
|
const ModelInstance* hitInstance;
|
||||||
const GroupModel* hitModel;
|
const GroupModel* hitModel;
|
||||||
float ground_Z;
|
float ground_Z;
|
||||||
|
|||||||
@@ -64,7 +64,7 @@ namespace VMAP
|
|||||||
class WmoLiquid* liquid;
|
class WmoLiquid* liquid;
|
||||||
|
|
||||||
GroupModel_Raw() : mogpflags(0), GroupWMOID(0), liquidflags(0),
|
GroupModel_Raw() : mogpflags(0), GroupWMOID(0), liquidflags(0),
|
||||||
liquid(NULL) { }
|
liquid(nullptr) { }
|
||||||
~GroupModel_Raw();
|
~GroupModel_Raw();
|
||||||
|
|
||||||
bool Read(FILE* f);
|
bool Read(FILE* f);
|
||||||
|
|||||||
@@ -34,7 +34,7 @@ class GameObjectModel /*, public Intersectable*/
|
|||||||
VMAP::WorldModel* iModel;
|
VMAP::WorldModel* iModel;
|
||||||
GameObject const* owner;
|
GameObject const* owner;
|
||||||
|
|
||||||
GameObjectModel() : phasemask(0), iInvScale(0), iScale(0), iModel(NULL), owner(NULL) { }
|
GameObjectModel() : phasemask(0), iInvScale(0), iScale(0), iModel(nullptr), owner(nullptr) { }
|
||||||
bool initialize(const GameObject& go, const GameObjectDisplayInfoEntry& info);
|
bool initialize(const GameObject& go, const GameObjectDisplayInfoEntry& info);
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|||||||
@@ -51,9 +51,9 @@ namespace VMAP
|
|||||||
class ModelInstance: public ModelSpawn
|
class ModelInstance: public ModelSpawn
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
ModelInstance(): iInvScale(0.0f), iModel(0) { }
|
ModelInstance(): iInvScale(0.0f), iModel(nullptr) { }
|
||||||
ModelInstance(const ModelSpawn& spawn, WorldModel* model);
|
ModelInstance(const ModelSpawn& spawn, WorldModel* model);
|
||||||
void setUnloaded() { iModel = 0; }
|
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;
|
||||||
void intersectPoint(const G3D::Vector3& p, AreaInfo& info) const;
|
void intersectPoint(const G3D::Vector3& p, AreaInfo& info) const;
|
||||||
bool GetLocationInfo(const G3D::Vector3& p, LocationInfo& info) const;
|
bool GetLocationInfo(const G3D::Vector3& p, LocationInfo& info) const;
|
||||||
|
|||||||
@@ -47,7 +47,7 @@ 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(0), iFlags(0) { }
|
WmoLiquid(): iTilesX(0), iTilesY(0), iType(0), iHeight(nullptr), iFlags(nullptr) { }
|
||||||
uint32 iTilesX; //!< number of tiles in x direction, each
|
uint32 iTilesX; //!< number of tiles in x direction, each
|
||||||
uint32 iTilesY;
|
uint32 iTilesY;
|
||||||
G3D::Vector3 iCorner; //!< the lower corner
|
G3D::Vector3 iCorner; //!< the lower corner
|
||||||
@@ -62,15 +62,15 @@ namespace VMAP
|
|||||||
class GroupModel
|
class GroupModel
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
GroupModel(): iMogpFlags(0), iGroupWMOID(0), iLiquid(0) { }
|
GroupModel(): iMogpFlags(0), iGroupWMOID(0), iLiquid(nullptr) { }
|
||||||
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(0) { }
|
iBound(bound), iMogpFlags(mogpFlags), iGroupWMOID(groupWMOID), iLiquid(nullptr) { }
|
||||||
~GroupModel() { delete iLiquid; }
|
~GroupModel() { delete iLiquid; }
|
||||||
|
|
||||||
//! pass mesh data to object and create BIH. Passed vectors get get swapped with old geometry!
|
//! pass mesh data to object and create BIH. Passed vectors get get swapped with old geometry!
|
||||||
void setMeshData(std::vector<G3D::Vector3>& vert, std::vector<MeshTriangle>& tri);
|
void setMeshData(std::vector<G3D::Vector3>& vert, std::vector<MeshTriangle>& tri);
|
||||||
void setLiquidData(WmoLiquid*& liquid) { iLiquid = liquid; liquid = NULL; }
|
void setLiquidData(WmoLiquid*& liquid) { iLiquid = liquid; liquid = nullptr; }
|
||||||
bool IntersectRay(const G3D::Ray& ray, float& distance, bool stopAtFirstHit) const;
|
bool IntersectRay(const G3D::Ray& ray, float& distance, bool stopAtFirstHit) const;
|
||||||
bool IsInsideObject(const G3D::Vector3& pos, const G3D::Vector3& down, float& z_dist) const;
|
bool IsInsideObject(const G3D::Vector3& pos, const G3D::Vector3& down, float& z_dist) const;
|
||||||
bool GetLiquidLevel(const G3D::Vector3& pos, float& liqHeight) const;
|
bool GetLiquidLevel(const G3D::Vector3& pos, float& liqHeight) const;
|
||||||
|
|||||||
@@ -172,7 +172,7 @@ public:
|
|||||||
|
|
||||||
if (data.raw)
|
if (data.raw)
|
||||||
return *reinterpret_cast<int64*>(data.value);
|
return *reinterpret_cast<int64*>(data.value);
|
||||||
return static_cast<int64>(strtol((char*)data.value, NULL, 10));
|
return static_cast<int64>(strtol((char*)data.value, nullptr, 10));
|
||||||
}
|
}
|
||||||
|
|
||||||
[[nodiscard]] float GetFloat() const
|
[[nodiscard]] float GetFloat() const
|
||||||
@@ -214,7 +214,7 @@ public:
|
|||||||
[[nodiscard]] char const* GetCString() const
|
[[nodiscard]] char const* GetCString() const
|
||||||
{
|
{
|
||||||
if (!data.value)
|
if (!data.value)
|
||||||
return NULL;
|
return nullptr;
|
||||||
|
|
||||||
#ifdef ACORE_DEBUG
|
#ifdef ACORE_DEBUG
|
||||||
if (IsNumeric())
|
if (IsNumeric())
|
||||||
@@ -244,7 +244,7 @@ public:
|
|||||||
|
|
||||||
[[nodiscard]] bool IsNull() const
|
[[nodiscard]] bool IsNull() const
|
||||||
{
|
{
|
||||||
return data.value == NULL;
|
return data.value == nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
@@ -275,7 +275,7 @@ protected:
|
|||||||
void CleanUp()
|
void CleanUp()
|
||||||
{
|
{
|
||||||
delete[] ((char*)data.value);
|
delete[] ((char*)data.value);
|
||||||
data.value = NULL;
|
data.value = nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
static size_t SizeForType(MYSQL_FIELD* field)
|
static size_t SizeForType(MYSQL_FIELD* field)
|
||||||
|
|||||||
@@ -79,7 +79,7 @@ public:
|
|||||||
void CommitTransaction();
|
void CommitTransaction();
|
||||||
bool ExecuteTransaction(SQLTransaction& transaction);
|
bool ExecuteTransaction(SQLTransaction& transaction);
|
||||||
|
|
||||||
operator bool () const { return m_Mysql != NULL; }
|
operator bool () const { return m_Mysql != nullptr; }
|
||||||
void Ping() { mysql_ping(m_Mysql); }
|
void Ping() { mysql_ping(m_Mysql); }
|
||||||
|
|
||||||
uint32 GetLastError() { return mysql_errno(m_Mysql); }
|
uint32 GetLastError() { return mysql_errno(m_Mysql); }
|
||||||
|
|||||||
@@ -35,7 +35,7 @@ public:
|
|||||||
|
|
||||||
static void Library_Init()
|
static void Library_Init()
|
||||||
{
|
{
|
||||||
mysql_library_init(-1, NULL, NULL);
|
mysql_library_init(-1, nullptr, nullptr);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void Library_End()
|
static void Library_End()
|
||||||
|
|||||||
@@ -48,7 +48,7 @@ class MySQLConnection;
|
|||||||
class SQLOperation : public ACE_Method_Request
|
class SQLOperation : public ACE_Method_Request
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
SQLOperation(): m_conn(NULL) { }
|
SQLOperation(): m_conn(nullptr) { }
|
||||||
int call() override
|
int call() override
|
||||||
{
|
{
|
||||||
Execute();
|
Execute();
|
||||||
|
|||||||
@@ -21,17 +21,17 @@ private:
|
|||||||
LinkedListElement* iNext;
|
LinkedListElement* iNext;
|
||||||
LinkedListElement* iPrev;
|
LinkedListElement* iPrev;
|
||||||
public:
|
public:
|
||||||
LinkedListElement(): iNext(NULL), iPrev(NULL) { }
|
LinkedListElement(): iNext(nullptr), iPrev(nullptr) { }
|
||||||
~LinkedListElement() { delink(); }
|
~LinkedListElement() { delink(); }
|
||||||
|
|
||||||
[[nodiscard]] bool hasNext() const { return (iNext && iNext->iNext != NULL); }
|
[[nodiscard]] bool hasNext() const { return (iNext && iNext->iNext != nullptr); }
|
||||||
[[nodiscard]] bool hasPrev() const { return (iPrev && iPrev->iPrev != NULL); }
|
[[nodiscard]] bool hasPrev() const { return (iPrev && iPrev->iPrev != nullptr); }
|
||||||
[[nodiscard]] bool isInList() const { return (iNext != NULL && iPrev != NULL); }
|
[[nodiscard]] bool isInList() const { return (iNext != nullptr && iPrev != nullptr); }
|
||||||
|
|
||||||
LinkedListElement* next() { return hasNext() ? iNext : NULL; }
|
LinkedListElement* next() { return hasNext() ? iNext : nullptr; }
|
||||||
[[nodiscard]] LinkedListElement const* next() const { return hasNext() ? iNext : NULL; }
|
[[nodiscard]] LinkedListElement const* next() const { return hasNext() ? iNext : nullptr; }
|
||||||
LinkedListElement* prev() { return hasPrev() ? iPrev : NULL; }
|
LinkedListElement* prev() { return hasPrev() ? iPrev : nullptr; }
|
||||||
[[nodiscard]] LinkedListElement const* prev() const { return hasPrev() ? iPrev : NULL; }
|
[[nodiscard]] LinkedListElement const* prev() const { return hasPrev() ? iPrev : nullptr; }
|
||||||
|
|
||||||
LinkedListElement* nocheck_next() { return iNext; }
|
LinkedListElement* nocheck_next() { return iNext; }
|
||||||
[[nodiscard]] LinkedListElement const* nocheck_next() const { return iNext; }
|
[[nodiscard]] LinkedListElement const* nocheck_next() const { return iNext; }
|
||||||
@@ -44,8 +44,8 @@ public:
|
|||||||
{
|
{
|
||||||
iNext->iPrev = iPrev;
|
iNext->iPrev = iPrev;
|
||||||
iPrev->iNext = iNext;
|
iPrev->iNext = iNext;
|
||||||
iNext = NULL;
|
iNext = nullptr;
|
||||||
iPrev = NULL;
|
iPrev = nullptr;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -85,11 +85,11 @@ public:
|
|||||||
|
|
||||||
[[nodiscard]] bool isEmpty() const { return (!iFirst.iNext->isInList()); }
|
[[nodiscard]] bool isEmpty() const { return (!iFirst.iNext->isInList()); }
|
||||||
|
|
||||||
LinkedListElement* getFirst() { return (isEmpty() ? NULL : iFirst.iNext); }
|
LinkedListElement* getFirst() { return (isEmpty() ? nullptr : iFirst.iNext); }
|
||||||
[[nodiscard]] LinkedListElement const* getFirst() const { return (isEmpty() ? NULL : iFirst.iNext); }
|
[[nodiscard]] LinkedListElement const* getFirst() const { return (isEmpty() ? nullptr : iFirst.iNext); }
|
||||||
|
|
||||||
LinkedListElement* getLast() { return (isEmpty() ? NULL : iLast.iPrev); }
|
LinkedListElement* getLast() { return (isEmpty() ? nullptr : iLast.iPrev); }
|
||||||
[[nodiscard]] LinkedListElement const* getLast() const { return (isEmpty() ? NULL : iLast.iPrev); }
|
[[nodiscard]] LinkedListElement const* getLast() const { return (isEmpty() ? nullptr : iLast.iPrev); }
|
||||||
|
|
||||||
void insertFirst(LinkedListElement* pElem)
|
void insertFirst(LinkedListElement* pElem)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -31,7 +31,7 @@ public:
|
|||||||
void clearReferences()
|
void clearReferences()
|
||||||
{
|
{
|
||||||
LinkedListElement* ref;
|
LinkedListElement* ref;
|
||||||
while ((ref = getFirst()) != NULL)
|
while ((ref = getFirst()) != nullptr)
|
||||||
{
|
{
|
||||||
((Reference<TO, FROM>*) ref)->invalidate();
|
((Reference<TO, FROM>*) ref)->invalidate();
|
||||||
ref->delink(); // the delink might be already done by invalidate(), but doing it here again does not hurt and insures an empty list
|
ref->delink(); // the delink might be already done by invalidate(), but doing it here again does not hurt and insures an empty list
|
||||||
|
|||||||
@@ -27,7 +27,7 @@ protected:
|
|||||||
// Tell our refFrom (source) object, that the link is cut (Target destroyed)
|
// Tell our refFrom (source) object, that the link is cut (Target destroyed)
|
||||||
virtual void sourceObjectDestroyLink() = 0;
|
virtual void sourceObjectDestroyLink() = 0;
|
||||||
public:
|
public:
|
||||||
Reference() { iRefTo = NULL; iRefFrom = NULL; }
|
Reference() { iRefTo = nullptr; iRefFrom = nullptr; }
|
||||||
virtual ~Reference() { }
|
virtual ~Reference() { }
|
||||||
|
|
||||||
// Create new link
|
// Create new link
|
||||||
@@ -36,7 +36,7 @@ public:
|
|||||||
ASSERT(fromObj); // fromObj MUST not be NULL
|
ASSERT(fromObj); // fromObj MUST not be NULL
|
||||||
if (isValid())
|
if (isValid())
|
||||||
unlink();
|
unlink();
|
||||||
if (toObj != NULL)
|
if (toObj != nullptr)
|
||||||
{
|
{
|
||||||
iRefTo = toObj;
|
iRefTo = toObj;
|
||||||
iRefFrom = fromObj;
|
iRefFrom = fromObj;
|
||||||
@@ -50,8 +50,8 @@ public:
|
|||||||
{
|
{
|
||||||
targetObjectDestroyLink();
|
targetObjectDestroyLink();
|
||||||
delink();
|
delink();
|
||||||
iRefTo = NULL;
|
iRefTo = nullptr;
|
||||||
iRefFrom = NULL;
|
iRefFrom = nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Link is invalid due to destruction of referenced target object. Call comes from the refTo object
|
// Link is invalid due to destruction of referenced target object. Call comes from the refTo object
|
||||||
@@ -60,12 +60,12 @@ public:
|
|||||||
{
|
{
|
||||||
sourceObjectDestroyLink();
|
sourceObjectDestroyLink();
|
||||||
delink();
|
delink();
|
||||||
iRefTo = NULL;
|
iRefTo = nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
[[nodiscard]] bool isValid() const // Only check the iRefTo
|
[[nodiscard]] bool isValid() const // Only check the iRefTo
|
||||||
{
|
{
|
||||||
return iRefTo != NULL;
|
return iRefTo != nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
Reference<TO, FROM>* next() { return ((Reference<TO, FROM>*) LinkedListElement::next()); }
|
Reference<TO, FROM>* next() { return ((Reference<TO, FROM>*) LinkedListElement::next()); }
|
||||||
|
|||||||
@@ -16,7 +16,7 @@ namespace acore
|
|||||||
class SignalHandler : public ACE_Event_Handler
|
class SignalHandler : public ACE_Event_Handler
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
int handle_signal(int SigNum, siginfo_t* = NULL, ucontext_t* = NULL) override
|
int handle_signal(int SigNum, siginfo_t* = nullptr, ucontext_t* = nullptr) override
|
||||||
{
|
{
|
||||||
HandleSignal(SigNum);
|
HandleSignal(SigNum);
|
||||||
return 0;
|
return 0;
|
||||||
|
|||||||
@@ -26,7 +26,7 @@ public:
|
|||||||
protected:
|
protected:
|
||||||
virtual int make_svc_handler(RealmSocket*& sh)
|
virtual int make_svc_handler(RealmSocket*& sh)
|
||||||
{
|
{
|
||||||
if (sh == 0)
|
if (sh == nullptr)
|
||||||
ACE_NEW_RETURN(sh, RealmSocket, -1);
|
ACE_NEW_RETURN(sh, RealmSocket, -1);
|
||||||
|
|
||||||
sh->reactor(reactor());
|
sh->reactor(reactor());
|
||||||
|
|||||||
@@ -464,7 +464,7 @@ public:
|
|||||||
// Packet Transfer
|
// Packet Transfer
|
||||||
// method that should fill worldpacket with actual world states (not yet implemented for all battlegrounds!)
|
// method that should fill worldpacket with actual world states (not yet implemented for all battlegrounds!)
|
||||||
virtual void FillInitialWorldStates(WorldPacket& /*data*/) {}
|
virtual void FillInitialWorldStates(WorldPacket& /*data*/) {}
|
||||||
void SendPacketToTeam(TeamId teamId, WorldPacket* packet, Player* sender = NULL, bool self = true);
|
void SendPacketToTeam(TeamId teamId, WorldPacket* packet, Player* sender = nullptr, bool self = true);
|
||||||
void SendPacketToAll(WorldPacket* packet);
|
void SendPacketToAll(WorldPacket* packet);
|
||||||
void YellToAll(Creature* creature, const char* text, uint32 language);
|
void YellToAll(Creature* creature, const char* text, uint32 language);
|
||||||
|
|
||||||
|
|||||||
@@ -149,7 +149,7 @@ public:
|
|||||||
|
|
||||||
[[nodiscard]] HostileReference* getMostHated() const
|
[[nodiscard]] HostileReference* getMostHated() const
|
||||||
{
|
{
|
||||||
return iThreatList.empty() ? NULL : iThreatList.front();
|
return iThreatList.empty() ? nullptr : iThreatList.front();
|
||||||
}
|
}
|
||||||
|
|
||||||
HostileReference* getReferenceByTarget(Unit* victim) const;
|
HostileReference* getReferenceByTarget(Unit* victim) const;
|
||||||
|
|||||||
@@ -166,7 +166,7 @@ struct ConditionSourceInfo
|
|||||||
{
|
{
|
||||||
WorldObject* mConditionTargets[MAX_CONDITION_TARGETS]; // an array of targets available for conditions
|
WorldObject* mConditionTargets[MAX_CONDITION_TARGETS]; // an array of targets available for conditions
|
||||||
Condition* mLastFailedCondition;
|
Condition* mLastFailedCondition;
|
||||||
ConditionSourceInfo(WorldObject* target0, WorldObject* target1 = NULL, WorldObject* target2 = nullptr)
|
ConditionSourceInfo(WorldObject* target0, WorldObject* target1 = nullptr, WorldObject* target2 = nullptr)
|
||||||
{
|
{
|
||||||
mConditionTargets[0] = target0;
|
mConditionTargets[0] = target0;
|
||||||
mConditionTargets[1] = target1;
|
mConditionTargets[1] = target1;
|
||||||
|
|||||||
@@ -448,7 +448,7 @@ public:
|
|||||||
[[nodiscard]] uint32 GetDBTableGUIDLow() const { return m_DBTableGuid; }
|
[[nodiscard]] uint32 GetDBTableGUIDLow() const { return m_DBTableGuid; }
|
||||||
|
|
||||||
void Update(uint32 time) override; // overwrited Unit::Update
|
void Update(uint32 time) override; // overwrited Unit::Update
|
||||||
void GetRespawnPosition(float& x, float& y, float& z, float* ori = NULL, float* dist = NULL) const;
|
void GetRespawnPosition(float& x, float& y, float& z, float* ori = nullptr, float* dist = nullptr) const;
|
||||||
|
|
||||||
void SetCorpseDelay(uint32 delay) { m_corpseDelay = delay; }
|
void SetCorpseDelay(uint32 delay) { m_corpseDelay = delay; }
|
||||||
[[nodiscard]] uint32 GetCorpseDelay() const { return m_corpseDelay; }
|
[[nodiscard]] uint32 GetCorpseDelay() const { return m_corpseDelay; }
|
||||||
@@ -531,7 +531,7 @@ public:
|
|||||||
|
|
||||||
[[nodiscard]] bool HasSpell(uint32 spellID) const override;
|
[[nodiscard]] bool HasSpell(uint32 spellID) const override;
|
||||||
|
|
||||||
bool UpdateEntry(uint32 entry, const CreatureData* data = NULL, bool changelevel = true );
|
bool UpdateEntry(uint32 entry, const CreatureData* data = nullptr, bool changelevel = true );
|
||||||
bool UpdateStats(Stats stat) override;
|
bool UpdateStats(Stats stat) override;
|
||||||
bool UpdateAllStats() override;
|
bool UpdateAllStats() override;
|
||||||
void UpdateResistances(uint32 school) override;
|
void UpdateResistances(uint32 school) override;
|
||||||
@@ -724,7 +724,7 @@ public:
|
|||||||
|
|
||||||
protected:
|
protected:
|
||||||
bool CreateFromProto(uint32 guidlow, uint32 Entry, uint32 vehId, const CreatureData* data = nullptr);
|
bool CreateFromProto(uint32 guidlow, uint32 Entry, uint32 vehId, const CreatureData* data = nullptr);
|
||||||
bool InitEntry(uint32 entry, const CreatureData* data = NULL);
|
bool InitEntry(uint32 entry, const CreatureData* data = nullptr);
|
||||||
|
|
||||||
// vendor items
|
// vendor items
|
||||||
VendorItemCounts m_vendorItemCounts;
|
VendorItemCounts m_vendorItemCounts;
|
||||||
|
|||||||
@@ -901,10 +901,10 @@ public:
|
|||||||
|
|
||||||
void SendMessageToSetInRange(WorldPacket* data, float dist, bool /*self*/, bool includeMargin = false, Player const* skipped_rcvr = nullptr) override; // pussywizard!
|
void SendMessageToSetInRange(WorldPacket* data, float dist, bool /*self*/, bool includeMargin = false, Player const* skipped_rcvr = nullptr) override; // pussywizard!
|
||||||
|
|
||||||
void ModifyHealth(int32 change, Unit* attackerOrHealer = NULL, uint32 spellId = 0);
|
void ModifyHealth(int32 change, Unit* attackerOrHealer = nullptr, uint32 spellId = 0);
|
||||||
void SetDestructibleBuildingModifyState(bool allow) { m_allowModifyDestructibleBuilding = allow; }
|
void SetDestructibleBuildingModifyState(bool allow) { m_allowModifyDestructibleBuilding = allow; }
|
||||||
// sets GameObject type 33 destruction flags and optionally default health for that state
|
// sets GameObject type 33 destruction flags and optionally default health for that state
|
||||||
void SetDestructibleState(GameObjectDestructibleState state, Player* eventInvoker = NULL, bool setHealth = false);
|
void SetDestructibleState(GameObjectDestructibleState state, Player* eventInvoker = nullptr, bool setHealth = false);
|
||||||
[[nodiscard]] GameObjectDestructibleState GetDestructibleState() const
|
[[nodiscard]] GameObjectDestructibleState GetDestructibleState() const
|
||||||
{
|
{
|
||||||
if (HasFlag(GAMEOBJECT_FLAGS, GO_FLAG_DESTROYED))
|
if (HasFlag(GAMEOBJECT_FLAGS, GO_FLAG_DESTROYED))
|
||||||
|
|||||||
@@ -196,7 +196,7 @@ bool ItemCanGoIntoBag(ItemTemplate const* proto, ItemTemplate const* pBagProto);
|
|||||||
class Item : public Object
|
class Item : public Object
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
static Item* CreateItem(uint32 item, uint32 count, Player const* player = NULL, bool clone = false, uint32 randomPropertyId = 0);
|
static Item* CreateItem(uint32 item, uint32 count, Player const* player = nullptr, bool clone = false, uint32 randomPropertyId = 0);
|
||||||
Item* CloneItem(uint32 count, Player const* player = nullptr) const;
|
Item* CloneItem(uint32 count, Player const* player = nullptr) const;
|
||||||
|
|
||||||
Item();
|
Item();
|
||||||
|
|||||||
@@ -790,7 +790,7 @@ public:
|
|||||||
void GetNearPoint2D(float& x, float& y, float distance, float absAngle) const;
|
void GetNearPoint2D(float& x, float& y, float distance, float absAngle) const;
|
||||||
void GetNearPoint(WorldObject const* searcher, float& x, float& y, float& z, float searcher_size, float distance2d, float absAngle, float controlZ = 0) const;
|
void GetNearPoint(WorldObject const* searcher, float& x, float& y, float& z, float searcher_size, float distance2d, float absAngle, float controlZ = 0) const;
|
||||||
void GetVoidClosePoint(float& x, float& y, float& z, float size, float distance2d = 0, float relAngle = 0, float controlZ = 0) const;
|
void GetVoidClosePoint(float& x, float& y, float& z, float size, float distance2d = 0, float relAngle = 0, float controlZ = 0) const;
|
||||||
bool GetClosePoint(float& x, float& y, float& z, float size, float distance2d = 0, float angle = 0, const WorldObject* forWho = NULL, bool force = false) const;
|
bool GetClosePoint(float& x, float& y, float& z, float size, float distance2d = 0, float angle = 0, const WorldObject* forWho = nullptr, bool force = false) const;
|
||||||
void MovePosition(Position& pos, float dist, float angle);
|
void MovePosition(Position& pos, float dist, float angle);
|
||||||
void GetNearPosition(Position& pos, float dist, float angle)
|
void GetNearPosition(Position& pos, float dist, float angle)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -1202,13 +1202,13 @@ public:
|
|||||||
[[nodiscard]] uint8 GetChatTag() const;
|
[[nodiscard]] uint8 GetChatTag() const;
|
||||||
std::string autoReplyMsg;
|
std::string autoReplyMsg;
|
||||||
|
|
||||||
uint32 GetBarberShopCost(uint8 newhairstyle, uint8 newhaircolor, uint8 newfacialhair, BarberShopStyleEntry const* newSkin = NULL);
|
uint32 GetBarberShopCost(uint8 newhairstyle, uint8 newhaircolor, uint8 newfacialhair, BarberShopStyleEntry const* newSkin = nullptr);
|
||||||
|
|
||||||
PlayerSocial* GetSocial() { return m_social; }
|
PlayerSocial* GetSocial() { return m_social; }
|
||||||
|
|
||||||
PlayerTaxi m_taxi;
|
PlayerTaxi m_taxi;
|
||||||
void InitTaxiNodesForLevel() { m_taxi.InitTaxiNodesForLevel(getRace(), getClass(), getLevel()); }
|
void InitTaxiNodesForLevel() { m_taxi.InitTaxiNodesForLevel(getRace(), getClass(), getLevel()); }
|
||||||
bool ActivateTaxiPathTo(std::vector<uint32> const& nodes, Creature* npc = NULL, uint32 spellid = 1);
|
bool ActivateTaxiPathTo(std::vector<uint32> const& nodes, Creature* npc = nullptr, uint32 spellid = 1);
|
||||||
bool ActivateTaxiPathTo(uint32 taxi_path_id, uint32 spellid = 1);
|
bool ActivateTaxiPathTo(uint32 taxi_path_id, uint32 spellid = 1);
|
||||||
void CleanupAfterTaxiFlight();
|
void CleanupAfterTaxiFlight();
|
||||||
void ContinueTaxiFlight();
|
void ContinueTaxiFlight();
|
||||||
@@ -1308,7 +1308,7 @@ public:
|
|||||||
[[nodiscard]] InventoryResult CanTakeMoreSimilarItems(uint32 entry, uint32 count) const { return CanTakeMoreSimilarItems(entry, count, nullptr); }
|
[[nodiscard]] InventoryResult CanTakeMoreSimilarItems(uint32 entry, uint32 count) const { return CanTakeMoreSimilarItems(entry, count, nullptr); }
|
||||||
InventoryResult CanStoreNewItem(uint8 bag, uint8 slot, ItemPosCountVec& dest, uint32 item, uint32 count, uint32* no_space_count = nullptr) const
|
InventoryResult CanStoreNewItem(uint8 bag, uint8 slot, ItemPosCountVec& dest, uint32 item, uint32 count, uint32* no_space_count = nullptr) const
|
||||||
{
|
{
|
||||||
return CanStoreItem(bag, slot, dest, item, count, NULL, false, no_space_count);
|
return CanStoreItem(bag, slot, dest, item, count, nullptr, false, no_space_count);
|
||||||
}
|
}
|
||||||
InventoryResult CanStoreItem(uint8 bag, uint8 slot, ItemPosCountVec& dest, Item* pItem, bool swap = false) const
|
InventoryResult CanStoreItem(uint8 bag, uint8 slot, ItemPosCountVec& dest, Item* pItem, bool swap = false) const
|
||||||
{
|
{
|
||||||
@@ -1346,7 +1346,7 @@ public:
|
|||||||
void UpdateTitansGrip();
|
void UpdateTitansGrip();
|
||||||
|
|
||||||
InventoryResult CanTakeMoreSimilarItems(uint32 entry, uint32 count, Item* pItem, uint32* no_space_count = nullptr) const;
|
InventoryResult CanTakeMoreSimilarItems(uint32 entry, uint32 count, Item* pItem, uint32* no_space_count = nullptr) const;
|
||||||
InventoryResult CanStoreItem(uint8 bag, uint8 slot, ItemPosCountVec& dest, uint32 entry, uint32 count, Item* pItem = NULL, bool swap = false, uint32* no_space_count = nullptr) const;
|
InventoryResult CanStoreItem(uint8 bag, uint8 slot, ItemPosCountVec& dest, uint32 entry, uint32 count, Item* pItem = nullptr, bool swap = false, uint32* no_space_count = nullptr) const;
|
||||||
|
|
||||||
void AddRefundReference(uint32 it);
|
void AddRefundReference(uint32 it);
|
||||||
void DeleteRefundReference(uint32 it);
|
void DeleteRefundReference(uint32 it);
|
||||||
@@ -1381,7 +1381,7 @@ public:
|
|||||||
Item* GetItemFromBuyBackSlot(uint32 slot);
|
Item* GetItemFromBuyBackSlot(uint32 slot);
|
||||||
void RemoveItemFromBuyBackSlot(uint32 slot, bool del);
|
void RemoveItemFromBuyBackSlot(uint32 slot, bool del);
|
||||||
[[nodiscard]] uint32 GetMaxKeyringSize() const { return KEYRING_SLOT_END - KEYRING_SLOT_START; }
|
[[nodiscard]] uint32 GetMaxKeyringSize() const { return KEYRING_SLOT_END - KEYRING_SLOT_START; }
|
||||||
void SendEquipError(InventoryResult msg, Item* pItem, Item* pItem2 = NULL, uint32 itemid = 0);
|
void SendEquipError(InventoryResult msg, Item* pItem, Item* pItem2 = nullptr, uint32 itemid = 0);
|
||||||
void SendBuyError(BuyResult msg, Creature* creature, uint32 item, uint32 param);
|
void SendBuyError(BuyResult msg, Creature* creature, uint32 item, uint32 param);
|
||||||
void SendSellError(SellResult msg, Creature* creature, uint64 guid, uint32 param);
|
void SendSellError(SellResult msg, Creature* creature, uint64 guid, uint32 param);
|
||||||
void AddWeaponProficiency(uint32 newflag) { m_WeaponProficiency |= newflag; }
|
void AddWeaponProficiency(uint32 newflag) { m_WeaponProficiency |= newflag; }
|
||||||
@@ -1796,7 +1796,7 @@ public:
|
|||||||
void AddSpellMod(SpellModifier* mod, bool apply);
|
void AddSpellMod(SpellModifier* mod, bool apply);
|
||||||
bool IsAffectedBySpellmod(SpellInfo const* spellInfo, SpellModifier* mod, Spell* spell = nullptr);
|
bool IsAffectedBySpellmod(SpellInfo const* spellInfo, SpellModifier* mod, Spell* spell = nullptr);
|
||||||
bool HasSpellMod(SpellModifier* mod, Spell* spell);
|
bool HasSpellMod(SpellModifier* mod, Spell* spell);
|
||||||
template <class T> T ApplySpellMod(uint32 spellId, SpellModOp op, T& basevalue, Spell* spell = NULL, bool temporaryPet = false);
|
template <class T> T ApplySpellMod(uint32 spellId, SpellModOp op, T& basevalue, Spell* spell = nullptr, bool temporaryPet = false);
|
||||||
void RemoveSpellMods(Spell* spell);
|
void RemoveSpellMods(Spell* spell);
|
||||||
void RestoreSpellMods(Spell* spell, uint32 ownerAuraId = 0, Aura* aura = nullptr);
|
void RestoreSpellMods(Spell* spell, uint32 ownerAuraId = 0, Aura* aura = nullptr);
|
||||||
void RestoreAllSpellMods(uint32 ownerAuraId = 0, Aura* aura = nullptr);
|
void RestoreAllSpellMods(uint32 ownerAuraId = 0, Aura* aura = nullptr);
|
||||||
@@ -1820,10 +1820,10 @@ public:
|
|||||||
SpellCooldowns::const_iterator itr = m_spellCooldowns.find(spell_id);
|
SpellCooldowns::const_iterator itr = m_spellCooldowns.find(spell_id);
|
||||||
return uint32(itr != m_spellCooldowns.end() && itr->second.end > World::GetGameTimeMS() ? itr->second.end - World::GetGameTimeMS() : 0);
|
return uint32(itr != m_spellCooldowns.end() && itr->second.end > World::GetGameTimeMS() ? itr->second.end - World::GetGameTimeMS() : 0);
|
||||||
}
|
}
|
||||||
void AddSpellAndCategoryCooldowns(SpellInfo const* spellInfo, uint32 itemId, Spell* spell = NULL, bool infinityCooldown = false);
|
void AddSpellAndCategoryCooldowns(SpellInfo const* spellInfo, uint32 itemId, Spell* spell = nullptr, bool infinityCooldown = false);
|
||||||
void AddSpellCooldown(uint32 spell_id, uint32 itemid, uint32 end_time, bool needSendToClient = false, bool forceSendToSpectator = false) override;
|
void AddSpellCooldown(uint32 spell_id, uint32 itemid, uint32 end_time, bool needSendToClient = false, bool forceSendToSpectator = false) override;
|
||||||
void ModifySpellCooldown(uint32 spellId, int32 cooldown);
|
void ModifySpellCooldown(uint32 spellId, int32 cooldown);
|
||||||
void SendCooldownEvent(SpellInfo const* spellInfo, uint32 itemId = 0, Spell* spell = NULL, bool setCooldown = true);
|
void SendCooldownEvent(SpellInfo const* spellInfo, uint32 itemId = 0, Spell* spell = nullptr, bool setCooldown = true);
|
||||||
void ProhibitSpellSchool(SpellSchoolMask idSchoolMask, uint32 unTimeMs) override;
|
void ProhibitSpellSchool(SpellSchoolMask idSchoolMask, uint32 unTimeMs) override;
|
||||||
void RemoveSpellCooldown(uint32 spell_id, bool update = false);
|
void RemoveSpellCooldown(uint32 spell_id, bool update = false);
|
||||||
void SendClearCooldown(uint32 spell_id, Unit* target);
|
void SendClearCooldown(uint32 spell_id, Unit* target);
|
||||||
@@ -1910,7 +1910,7 @@ public:
|
|||||||
|
|
||||||
bool IsGroupVisibleFor(Player const* p) const;
|
bool IsGroupVisibleFor(Player const* p) const;
|
||||||
bool IsInSameGroupWith(Player const* p) const;
|
bool IsInSameGroupWith(Player const* p) const;
|
||||||
bool IsInSameRaidWith(Player const* p) const { return p == this || (GetGroup() != NULL && GetGroup() == p->GetGroup()); }
|
bool IsInSameRaidWith(Player const* p) const { return p == this || (GetGroup() != nullptr && GetGroup() == p->GetGroup()); }
|
||||||
void UninviteFromGroup();
|
void UninviteFromGroup();
|
||||||
static void RemoveFromGroup(Group* group, uint64 guid, RemoveMethod method = GROUP_REMOVEMETHOD_DEFAULT, uint64 kicker = 0, const char* reason = nullptr);
|
static void RemoveFromGroup(Group* group, uint64 guid, RemoveMethod method = GROUP_REMOVEMETHOD_DEFAULT, uint64 kicker = 0, const char* reason = nullptr);
|
||||||
void RemoveFromGroup(RemoveMethod method = GROUP_REMOVEMETHOD_DEFAULT) { RemoveFromGroup(GetGroup(), GetGUID(), method); }
|
void RemoveFromGroup(RemoveMethod method = GROUP_REMOVEMETHOD_DEFAULT) { RemoveFromGroup(GetGroup(), GetGUID(), method); }
|
||||||
|
|||||||
@@ -1440,8 +1440,8 @@ public:
|
|||||||
void CombatStop(bool includingCast = false);
|
void CombatStop(bool includingCast = false);
|
||||||
void CombatStopWithPets(bool includingCast = false);
|
void CombatStopWithPets(bool includingCast = false);
|
||||||
void StopAttackFaction(uint32 faction_id);
|
void StopAttackFaction(uint32 faction_id);
|
||||||
Unit* SelectNearbyTarget(Unit* exclude = NULL, float dist = NOMINAL_MELEE_RANGE) const;
|
Unit* SelectNearbyTarget(Unit* exclude = nullptr, float dist = NOMINAL_MELEE_RANGE) const;
|
||||||
Unit* SelectNearbyNoTotemTarget(Unit* exclude = NULL, float dist = NOMINAL_MELEE_RANGE) const;
|
Unit* SelectNearbyNoTotemTarget(Unit* exclude = nullptr, float dist = NOMINAL_MELEE_RANGE) const;
|
||||||
void SendMeleeAttackStop(Unit* victim = nullptr);
|
void SendMeleeAttackStop(Unit* victim = nullptr);
|
||||||
void SendMeleeAttackStart(Unit* victim, Player* sendTo = nullptr);
|
void SendMeleeAttackStart(Unit* victim, Player* sendTo = nullptr);
|
||||||
|
|
||||||
@@ -1581,11 +1581,11 @@ public:
|
|||||||
|
|
||||||
uint16 GetMaxSkillValueForLevel(Unit const* target = nullptr) const { return (target ? getLevelForTarget(target) : getLevel()) * 5; }
|
uint16 GetMaxSkillValueForLevel(Unit const* target = nullptr) const { return (target ? getLevelForTarget(target) : getLevel()) * 5; }
|
||||||
static void DealDamageMods(Unit const* victim, uint32& damage, uint32* absorb);
|
static void DealDamageMods(Unit const* victim, uint32& damage, uint32* absorb);
|
||||||
static uint32 DealDamage(Unit* attacker, Unit* victim, uint32 damage, CleanDamage const* cleanDamage = NULL, DamageEffectType damagetype = DIRECT_DAMAGE, SpellSchoolMask damageSchoolMask = SPELL_SCHOOL_MASK_NORMAL, SpellInfo const* spellProto = NULL, bool durabilityLoss = true, bool allowGM = false);
|
static uint32 DealDamage(Unit* attacker, Unit* victim, uint32 damage, CleanDamage const* cleanDamage = nullptr, DamageEffectType damagetype = DIRECT_DAMAGE, SpellSchoolMask damageSchoolMask = SPELL_SCHOOL_MASK_NORMAL, SpellInfo const* spellProto = nullptr, bool durabilityLoss = true, bool allowGM = false);
|
||||||
static void Kill(Unit* killer, Unit* victim, bool durabilityLoss = true, WeaponAttackType attackType = BASE_ATTACK, SpellInfo const* spellProto = nullptr);
|
static void Kill(Unit* killer, Unit* victim, bool durabilityLoss = true, WeaponAttackType attackType = BASE_ATTACK, SpellInfo const* spellProto = nullptr);
|
||||||
static int32 DealHeal(Unit* healer, Unit* victim, uint32 addhealth);
|
static int32 DealHeal(Unit* healer, Unit* victim, uint32 addhealth);
|
||||||
|
|
||||||
void ProcDamageAndSpell(Unit* victim, uint32 procAttacker, uint32 procVictim, uint32 procEx, uint32 amount, WeaponAttackType attType = BASE_ATTACK, SpellInfo const* procSpell = NULL, SpellInfo const* procAura = nullptr);
|
void ProcDamageAndSpell(Unit* victim, uint32 procAttacker, uint32 procVictim, uint32 procEx, uint32 amount, WeaponAttackType attType = BASE_ATTACK, SpellInfo const* procSpell = nullptr, SpellInfo const* procAura = nullptr);
|
||||||
void ProcDamageAndSpellFor(bool isVictim, Unit* target, uint32 procFlag, uint32 procExtra, WeaponAttackType attType, SpellInfo const* procSpell, uint32 damage, SpellInfo const* procAura = nullptr);
|
void ProcDamageAndSpellFor(bool isVictim, Unit* target, uint32 procFlag, uint32 procExtra, WeaponAttackType attType, SpellInfo const* procSpell, uint32 damage, SpellInfo const* procAura = nullptr);
|
||||||
|
|
||||||
void GetProcAurasTriggeredOnEvent(std::list<AuraApplication*>& aurasTriggeringProc, std::list<AuraApplication*>* procAuras, ProcEventInfo eventInfo);
|
void GetProcAurasTriggeredOnEvent(std::list<AuraApplication*>& aurasTriggeringProc, std::list<AuraApplication*>* procAuras, ProcEventInfo eventInfo);
|
||||||
@@ -1702,7 +1702,7 @@ public:
|
|||||||
[[nodiscard]] bool IsPetInCombat() const { return HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_PET_IN_COMBAT); }
|
[[nodiscard]] bool IsPetInCombat() const { return HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_PET_IN_COMBAT); }
|
||||||
void CombatStart(Unit* target, bool initialAggro = true);
|
void CombatStart(Unit* target, bool initialAggro = true);
|
||||||
void CombatStartOnCast(Unit* target, bool initialAggro = true, uint32 duration = 0);
|
void CombatStartOnCast(Unit* target, bool initialAggro = true, uint32 duration = 0);
|
||||||
void SetInCombatState(bool PvP, Unit* enemy = NULL, uint32 duration = 0);
|
void SetInCombatState(bool PvP, Unit* enemy = nullptr, uint32 duration = 0);
|
||||||
void SetInCombatWith(Unit* enemy, uint32 duration = 0);
|
void SetInCombatWith(Unit* enemy, uint32 duration = 0);
|
||||||
void ClearInCombat();
|
void ClearInCombat();
|
||||||
void ClearInPetCombat();
|
void ClearInPetCombat();
|
||||||
@@ -1910,7 +1910,7 @@ public:
|
|||||||
bool InitTamedPet(Pet* pet, uint8 level, uint32 spell_id);
|
bool InitTamedPet(Pet* pet, uint8 level, uint32 spell_id);
|
||||||
|
|
||||||
// aura apply/remove helpers - you should better not use these
|
// aura apply/remove helpers - you should better not use these
|
||||||
Aura* _TryStackingOrRefreshingExistingAura(SpellInfo const* newAura, uint8 effMask, Unit* caster, int32* baseAmount = NULL, Item* castItem = NULL, uint64 casterGUID = 0, bool periodicReset = false);
|
Aura* _TryStackingOrRefreshingExistingAura(SpellInfo const* newAura, uint8 effMask, Unit* caster, int32* baseAmount = nullptr, Item* castItem = nullptr, uint64 casterGUID = 0, bool periodicReset = false);
|
||||||
void _AddAura(UnitAura* aura, Unit* caster);
|
void _AddAura(UnitAura* aura, Unit* caster);
|
||||||
AuraApplication* _CreateAuraApplication(Aura* aura, uint8 effMask);
|
AuraApplication* _CreateAuraApplication(Aura* aura, uint8 effMask);
|
||||||
void _ApplyAuraEffect(Aura* aura, uint8 effIndex);
|
void _ApplyAuraEffect(Aura* aura, uint8 effIndex);
|
||||||
@@ -1946,7 +1946,7 @@ public:
|
|||||||
void RemoveAurasDueToSpellByDispel(uint32 spellId, uint32 dispellerSpellId, uint64 casterGUID, Unit* dispeller, uint8 chargesRemoved = 1);
|
void RemoveAurasDueToSpellByDispel(uint32 spellId, uint32 dispellerSpellId, uint64 casterGUID, Unit* dispeller, uint8 chargesRemoved = 1);
|
||||||
void RemoveAurasDueToSpellBySteal(uint32 spellId, uint64 casterGUID, Unit* stealer);
|
void RemoveAurasDueToSpellBySteal(uint32 spellId, uint64 casterGUID, Unit* stealer);
|
||||||
void RemoveAurasDueToItemSpell(uint32 spellId, uint64 castItemGuid);
|
void RemoveAurasDueToItemSpell(uint32 spellId, uint64 castItemGuid);
|
||||||
void RemoveAurasByType(AuraType auraType, uint64 casterGUID = 0, Aura* except = NULL, bool negative = true, bool positive = true);
|
void RemoveAurasByType(AuraType auraType, uint64 casterGUID = 0, Aura* except = nullptr, bool negative = true, bool positive = true);
|
||||||
void RemoveNotOwnSingleTargetAuras();
|
void RemoveNotOwnSingleTargetAuras();
|
||||||
void RemoveAurasWithInterruptFlags(uint32 flag, uint32 except = 0);
|
void RemoveAurasWithInterruptFlags(uint32 flag, uint32 except = 0);
|
||||||
void RemoveAurasWithAttribute(uint32 flags);
|
void RemoveAurasWithAttribute(uint32 flags);
|
||||||
@@ -2163,7 +2163,7 @@ public:
|
|||||||
VisibleAuraMap::iterator itr = m_visibleAuras.find(slot);
|
VisibleAuraMap::iterator itr = m_visibleAuras.find(slot);
|
||||||
if (itr != m_visibleAuras.end())
|
if (itr != m_visibleAuras.end())
|
||||||
return itr->second;
|
return itr->second;
|
||||||
return 0;
|
return nullptr;
|
||||||
}
|
}
|
||||||
void SetVisibleAura(uint8 slot, AuraApplication* aur) { m_visibleAuras[slot] = aur; UpdateAuraForGroup(slot);}
|
void SetVisibleAura(uint8 slot, AuraApplication* aur) { m_visibleAuras[slot] = aur; UpdateAuraForGroup(slot);}
|
||||||
void RemoveVisibleAura(uint8 slot) { m_visibleAuras.erase(slot); UpdateAuraForGroup(slot);}
|
void RemoveVisibleAura(uint8 slot) { m_visibleAuras.erase(slot); UpdateAuraForGroup(slot);}
|
||||||
@@ -2195,7 +2195,7 @@ public:
|
|||||||
|
|
||||||
void ModifyAuraState(AuraStateType flag, bool apply);
|
void ModifyAuraState(AuraStateType flag, bool apply);
|
||||||
uint32 BuildAuraStateUpdateForTarget(Unit* target) const;
|
uint32 BuildAuraStateUpdateForTarget(Unit* target) const;
|
||||||
bool HasAuraState(AuraStateType flag, SpellInfo const* spellProto = NULL, Unit const* Caster = nullptr) const;
|
bool HasAuraState(AuraStateType flag, SpellInfo const* spellProto = nullptr, Unit const* Caster = nullptr) const;
|
||||||
void UnsummonAllTotems();
|
void UnsummonAllTotems();
|
||||||
Unit* GetMagicHitRedirectTarget(Unit* victim, SpellInfo const* spellInfo);
|
Unit* GetMagicHitRedirectTarget(Unit* victim, SpellInfo const* spellInfo);
|
||||||
Unit* GetMeleeHitRedirectTarget(Unit* victim, SpellInfo const* spellInfo = nullptr);
|
Unit* GetMeleeHitRedirectTarget(Unit* victim, SpellInfo const* spellInfo = nullptr);
|
||||||
@@ -2243,9 +2243,9 @@ public:
|
|||||||
bool IsImmunedToDamageOrSchool(SpellInfo const* spellInfo) const;
|
bool IsImmunedToDamageOrSchool(SpellInfo const* spellInfo) const;
|
||||||
virtual bool IsImmunedToSpellEffect(SpellInfo const* spellInfo, uint32 index) const;
|
virtual bool IsImmunedToSpellEffect(SpellInfo const* spellInfo, uint32 index) const;
|
||||||
// redefined in Creature
|
// redefined in Creature
|
||||||
static bool IsDamageReducedByArmor(SpellSchoolMask damageSchoolMask, SpellInfo const* spellInfo = NULL, uint8 effIndex = MAX_SPELL_EFFECTS);
|
static bool IsDamageReducedByArmor(SpellSchoolMask damageSchoolMask, SpellInfo const* spellInfo = nullptr, uint8 effIndex = MAX_SPELL_EFFECTS);
|
||||||
static uint32 CalcArmorReducedDamage(Unit const* attacker, Unit const* victim, const uint32 damage, SpellInfo const* spellInfo, uint8 attackerLevel = 0, WeaponAttackType attackType = MAX_ATTACK);
|
static uint32 CalcArmorReducedDamage(Unit const* attacker, Unit const* victim, const uint32 damage, SpellInfo const* spellInfo, uint8 attackerLevel = 0, WeaponAttackType attackType = MAX_ATTACK);
|
||||||
static void CalcAbsorbResist(Unit* attacker, Unit* victim, SpellSchoolMask schoolMask, DamageEffectType damagetype, const uint32 damage, uint32* absorb, uint32* resist, SpellInfo const* spellInfo = NULL, bool Splited = false);
|
static void CalcAbsorbResist(Unit* attacker, Unit* victim, SpellSchoolMask schoolMask, DamageEffectType damagetype, const uint32 damage, uint32* absorb, uint32* resist, SpellInfo const* spellInfo = nullptr, bool Splited = false);
|
||||||
static void CalcHealAbsorb(Unit const* victim, const SpellInfo* spellProto, uint32& healAmount, uint32& absorb);
|
static void CalcHealAbsorb(Unit const* victim, const SpellInfo* spellProto, uint32& healAmount, uint32& absorb);
|
||||||
|
|
||||||
void UpdateSpeed(UnitMoveType mtype, bool forced);
|
void UpdateSpeed(UnitMoveType mtype, bool forced);
|
||||||
@@ -2258,7 +2258,7 @@ public:
|
|||||||
int32 CalculateSpellDamage(Unit const* target, SpellInfo const* spellProto, uint8 effect_index, int32 const* basePoints = nullptr) const;
|
int32 CalculateSpellDamage(Unit const* target, SpellInfo const* spellProto, uint8 effect_index, int32 const* basePoints = nullptr) const;
|
||||||
int32 CalcSpellDuration(SpellInfo const* spellProto);
|
int32 CalcSpellDuration(SpellInfo const* spellProto);
|
||||||
int32 ModSpellDuration(SpellInfo const* spellProto, Unit const* target, int32 duration, bool positive, uint32 effectMask);
|
int32 ModSpellDuration(SpellInfo const* spellProto, Unit const* target, int32 duration, bool positive, uint32 effectMask);
|
||||||
void ModSpellCastTime(SpellInfo const* spellProto, int32& castTime, Spell* spell = NULL);
|
void ModSpellCastTime(SpellInfo const* spellProto, int32& castTime, Spell* spell = nullptr);
|
||||||
float CalculateLevelPenalty(SpellInfo const* spellProto) const;
|
float CalculateLevelPenalty(SpellInfo const* spellProto) const;
|
||||||
|
|
||||||
void addFollower(FollowerReference* pRef) { m_FollowingRefManager.insertFirst(pRef); }
|
void addFollower(FollowerReference* pRef) { m_FollowingRefManager.insertFirst(pRef); }
|
||||||
|
|||||||
@@ -104,12 +104,12 @@ public:
|
|||||||
static Unit* GetObjectInOrOutOfWorld(uint64 guid, Unit* /*typeSpecifier*/)
|
static Unit* GetObjectInOrOutOfWorld(uint64 guid, Unit* /*typeSpecifier*/)
|
||||||
{
|
{
|
||||||
if (IS_PLAYER_GUID(guid))
|
if (IS_PLAYER_GUID(guid))
|
||||||
return (Unit*)GetObjectInOrOutOfWorld(guid, (Player*)NULL);
|
return (Unit*)GetObjectInOrOutOfWorld(guid, (Player*)nullptr);
|
||||||
|
|
||||||
if (IS_PET_GUID(guid))
|
if (IS_PET_GUID(guid))
|
||||||
return (Unit*)GetObjectInOrOutOfWorld(guid, (Pet*)NULL);
|
return (Unit*)GetObjectInOrOutOfWorld(guid, (Pet*)nullptr);
|
||||||
|
|
||||||
return (Unit*)GetObjectInOrOutOfWorld(guid, (Creature*)NULL);
|
return (Unit*)GetObjectInOrOutOfWorld(guid, (Creature*)nullptr);
|
||||||
}
|
}
|
||||||
|
|
||||||
// returns object if is in world
|
// returns object if is in world
|
||||||
@@ -124,12 +124,12 @@ public:
|
|||||||
static Unit* GetObjectInWorld(uint64 guid, Unit* /*typeSpecifier*/)
|
static Unit* GetObjectInWorld(uint64 guid, Unit* /*typeSpecifier*/)
|
||||||
{
|
{
|
||||||
if (IS_PLAYER_GUID(guid))
|
if (IS_PLAYER_GUID(guid))
|
||||||
return (Unit*)GetObjectInWorld(guid, (Player*)NULL);
|
return (Unit*)GetObjectInWorld(guid, (Player*)nullptr);
|
||||||
|
|
||||||
if (IS_PET_GUID(guid))
|
if (IS_PET_GUID(guid))
|
||||||
return (Unit*)GetObjectInWorld(guid, (Pet*)NULL);
|
return (Unit*)GetObjectInWorld(guid, (Pet*)nullptr);
|
||||||
|
|
||||||
return (Unit*)GetObjectInWorld(guid, (Creature*)NULL);
|
return (Unit*)GetObjectInWorld(guid, (Creature*)nullptr);
|
||||||
}
|
}
|
||||||
|
|
||||||
// returns object if is in map
|
// returns object if is in map
|
||||||
|
|||||||
@@ -1286,7 +1286,7 @@ public:
|
|||||||
|
|
||||||
void AddVendorItem(uint32 entry, uint32 item, int32 maxcount, uint32 incrtime, uint32 extendedCost, bool persist = true); // for event
|
void AddVendorItem(uint32 entry, uint32 item, int32 maxcount, uint32 incrtime, uint32 extendedCost, bool persist = true); // for event
|
||||||
bool RemoveVendorItem(uint32 entry, uint32 item, bool persist = true); // for event
|
bool RemoveVendorItem(uint32 entry, uint32 item, bool persist = true); // for event
|
||||||
bool IsVendorItemValid(uint32 vendor_entry, uint32 item, int32 maxcount, uint32 ptime, uint32 ExtendedCost, Player* player = NULL, std::set<uint32>* skip_vendors = NULL, uint32 ORnpcflag = 0) const;
|
bool IsVendorItemValid(uint32 vendor_entry, uint32 item, int32 maxcount, uint32 ptime, uint32 ExtendedCost, Player* player = nullptr, std::set<uint32>* skip_vendors = nullptr, uint32 ORnpcflag = 0) const;
|
||||||
|
|
||||||
void LoadScriptNames();
|
void LoadScriptNames();
|
||||||
ScriptNameContainer& GetScriptNames() { return _scriptNamesStore; }
|
ScriptNameContainer& GetScriptNames() { return _scriptNamesStore; }
|
||||||
|
|||||||
@@ -362,7 +362,7 @@ struct Loot
|
|||||||
// Inserts the item into the loot (called by LootTemplate processors)
|
// Inserts the item into the loot (called by LootTemplate processors)
|
||||||
void AddItem(LootStoreItem const& item);
|
void AddItem(LootStoreItem const& item);
|
||||||
|
|
||||||
LootItem* LootItemInSlot(uint32 lootslot, Player* player, QuestItem** qitem = NULL, QuestItem** ffaitem = NULL, QuestItem** conditem = nullptr);
|
LootItem* LootItemInSlot(uint32 lootslot, Player* player, QuestItem** qitem = nullptr, QuestItem** ffaitem = nullptr, QuestItem** conditem = nullptr);
|
||||||
uint32 GetMaxSlotInLootFor(Player* player) const;
|
uint32 GetMaxSlotInLootFor(Player* player) const;
|
||||||
bool hasItemFor(Player* player) const;
|
bool hasItemFor(Player* player) const;
|
||||||
[[nodiscard]] bool hasOverThresholdItem() const;
|
[[nodiscard]] bool hasOverThresholdItem() const;
|
||||||
|
|||||||
@@ -213,7 +213,7 @@ public:
|
|||||||
[[nodiscard]] float getMinHeight(float x, float y) const;
|
[[nodiscard]] float getMinHeight(float x, float y) const;
|
||||||
[[nodiscard]] float getLiquidLevel(float x, float y) const;
|
[[nodiscard]] float getLiquidLevel(float x, float y) const;
|
||||||
[[nodiscard]] uint8 getTerrainType(float x, float y) const;
|
[[nodiscard]] uint8 getTerrainType(float x, float y) const;
|
||||||
ZLiquidStatus getLiquidStatus(float x, float y, float z, uint8 ReqLiquidType, LiquidData* data = 0);
|
ZLiquidStatus getLiquidStatus(float x, float y, float z, uint8 ReqLiquidType, LiquidData* data = nullptr);
|
||||||
};
|
};
|
||||||
|
|
||||||
// GCC have alternative #pragma pack(N) syntax and old gcc version not support pack(push, N), also any gcc version not support it at some platform
|
// GCC have alternative #pragma pack(N) syntax and old gcc version not support pack(push, N), also any gcc version not support it at some platform
|
||||||
@@ -357,7 +357,7 @@ public:
|
|||||||
[[nodiscard]] float GetMinHeight(float x, float y) const;
|
[[nodiscard]] float GetMinHeight(float x, float y) const;
|
||||||
Transport* GetTransportForPos(uint32 phase, float x, float y, float z, WorldObject* worldobject = nullptr);
|
Transport* GetTransportForPos(uint32 phase, float x, float y, float z, WorldObject* worldobject = nullptr);
|
||||||
|
|
||||||
ZLiquidStatus getLiquidStatus(float x, float y, float z, uint8 ReqLiquidType, LiquidData* data = 0) const;
|
ZLiquidStatus getLiquidStatus(float x, float y, float z, uint8 ReqLiquidType, LiquidData* data = nullptr) const;
|
||||||
|
|
||||||
uint32 GetAreaId(float x, float y, float z, bool* isOutdoors) const;
|
uint32 GetAreaId(float x, float y, float z, bool* isOutdoors) const;
|
||||||
bool GetAreaInfo(float x, float y, float z, uint32& mogpflags, int32& adtId, int32& rootId, int32& groupId) const;
|
bool GetAreaInfo(float x, float y, float z, uint32& mogpflags, int32& adtId, int32& rootId, int32& groupId) const;
|
||||||
@@ -369,7 +369,7 @@ public:
|
|||||||
|
|
||||||
[[nodiscard]] uint8 GetTerrainType(float x, float y) const;
|
[[nodiscard]] uint8 GetTerrainType(float x, float y) const;
|
||||||
[[nodiscard]] float GetWaterLevel(float x, float y) const;
|
[[nodiscard]] float GetWaterLevel(float x, float y) const;
|
||||||
bool IsInWater(float x, float y, float z, LiquidData* data = 0) const;
|
bool IsInWater(float x, float y, float z, LiquidData* data = nullptr) const;
|
||||||
[[nodiscard]] bool IsUnderWater(float x, float y, float z) const;
|
[[nodiscard]] bool IsUnderWater(float x, float y, float z) const;
|
||||||
|
|
||||||
void MoveAllCreaturesInMoveList();
|
void MoveAllCreaturesInMoveList();
|
||||||
@@ -451,7 +451,7 @@ public:
|
|||||||
|
|
||||||
void UpdateIteratorBack(Player* player);
|
void UpdateIteratorBack(Player* player);
|
||||||
|
|
||||||
TempSummon* SummonCreature(uint32 entry, Position const& pos, SummonPropertiesEntry const* properties = NULL, uint32 duration = 0, Unit* summoner = NULL, uint32 spellId = 0, uint32 vehId = 0);
|
TempSummon* SummonCreature(uint32 entry, Position const& pos, SummonPropertiesEntry const* properties = nullptr, uint32 duration = 0, Unit* summoner = nullptr, uint32 spellId = 0, uint32 vehId = 0);
|
||||||
GameObject* SummonGameObject(uint32 entry, float x, float y, float z, float ang, float rotation0, float rotation1, float rotation2, float rotation3, uint32 respawnTime, bool checkTransport = true);
|
GameObject* SummonGameObject(uint32 entry, float x, float y, float z, float ang, float rotation0, float rotation1, float rotation2, float rotation3, uint32 respawnTime, bool checkTransport = true);
|
||||||
void SummonCreatureGroup(uint8 group, std::list<TempSummon*>* list = nullptr);
|
void SummonCreatureGroup(uint8 group, std::list<TempSummon*>* list = nullptr);
|
||||||
Player* GetPlayer(uint64 guid);
|
Player* GetPlayer(uint64 guid);
|
||||||
@@ -471,7 +471,7 @@ public:
|
|||||||
BattlegroundMap* ToBattlegroundMap() { if (IsBattlegroundOrArena()) return reinterpret_cast<BattlegroundMap*>(this); else return nullptr; }
|
BattlegroundMap* ToBattlegroundMap() { if (IsBattlegroundOrArena()) return reinterpret_cast<BattlegroundMap*>(this); else return nullptr; }
|
||||||
[[nodiscard]] const BattlegroundMap* ToBattlegroundMap() const { if (IsBattlegroundOrArena()) return reinterpret_cast<BattlegroundMap const*>(this); return nullptr; }
|
[[nodiscard]] const BattlegroundMap* ToBattlegroundMap() const { if (IsBattlegroundOrArena()) return reinterpret_cast<BattlegroundMap const*>(this); return nullptr; }
|
||||||
|
|
||||||
float GetWaterOrGroundLevel(uint32 phasemask, float x, float y, float z, float* ground = NULL, bool swim = false, float maxSearchDist = 50.0f) const;
|
float GetWaterOrGroundLevel(uint32 phasemask, float x, float y, float z, float* ground = nullptr, bool swim = false, float maxSearchDist = 50.0f) const;
|
||||||
[[nodiscard]] float GetHeight(uint32 phasemask, float x, float y, float z, bool vmap = true, float maxSearchDist = DEFAULT_HEIGHT_SEARCH) const;
|
[[nodiscard]] float GetHeight(uint32 phasemask, float x, float y, float z, bool vmap = true, float maxSearchDist = DEFAULT_HEIGHT_SEARCH) const;
|
||||||
[[nodiscard]] bool isInLineOfSight(float x1, float y1, float z1, float x2, float y2, float z2, uint32 phasemask, LineOfSightChecks checks) const;
|
[[nodiscard]] bool isInLineOfSight(float x1, float y1, float z1, float x2, float y2, float z2, uint32 phasemask, LineOfSightChecks checks) const;
|
||||||
void Balance() { _dynamicTree.balance(); }
|
void Balance() { _dynamicTree.balance(); }
|
||||||
|
|||||||
@@ -178,7 +178,7 @@ public:
|
|||||||
void MoveTakeoff(uint32 id, Position const& pos, float speed);
|
void MoveTakeoff(uint32 id, Position const& pos, float speed);
|
||||||
void MoveTakeoff(uint32 id, float x, float y, float z, float speed); // pussywizard: added for easy calling by passing 3 floats x, y, z
|
void MoveTakeoff(uint32 id, float x, float y, float z, float speed); // pussywizard: added for easy calling by passing 3 floats x, y, z
|
||||||
|
|
||||||
void MoveCharge(float x, float y, float z, float speed = SPEED_CHARGE, uint32 id = EVENT_CHARGE, const Movement::PointsArray* path = NULL, bool generatePath = false, float orientation = 0.0f);
|
void MoveCharge(float x, float y, float z, float speed = SPEED_CHARGE, uint32 id = EVENT_CHARGE, const Movement::PointsArray* path = nullptr, bool generatePath = false, float orientation = 0.0f);
|
||||||
void MoveKnockbackFrom(float srcX, float srcY, float speedXY, float speedZ);
|
void MoveKnockbackFrom(float srcX, float srcY, float speedXY, float speedZ);
|
||||||
void MoveJumpTo(float angle, float speedXY, float speedZ);
|
void MoveJumpTo(float angle, float speedXY, float speedZ);
|
||||||
void MoveJump(Position const& pos, float speedXY, float speedZ, uint32 id = 0)
|
void MoveJump(Position const& pos, float speedXY, float speedZ, uint32 id = 0)
|
||||||
|
|||||||
@@ -713,10 +713,10 @@ public:
|
|||||||
void SendWorldText(uint32 string_id, ...);
|
void SendWorldText(uint32 string_id, ...);
|
||||||
void SendGlobalText(const char* text, WorldSession* self);
|
void SendGlobalText(const char* text, WorldSession* self);
|
||||||
void SendGMText(uint32 string_id, ...);
|
void SendGMText(uint32 string_id, ...);
|
||||||
void SendGlobalMessage(WorldPacket* packet, WorldSession* self = 0, TeamId teamId = TEAM_NEUTRAL);
|
void SendGlobalMessage(WorldPacket* packet, WorldSession* self = nullptr, TeamId teamId = TEAM_NEUTRAL);
|
||||||
void SendGlobalGMMessage(WorldPacket* packet, WorldSession* self = 0, TeamId teamId = TEAM_NEUTRAL);
|
void SendGlobalGMMessage(WorldPacket* packet, WorldSession* self = nullptr, TeamId teamId = TEAM_NEUTRAL);
|
||||||
bool SendZoneMessage(uint32 zone, WorldPacket* packet, WorldSession* self = 0, TeamId teamId = TEAM_NEUTRAL);
|
bool SendZoneMessage(uint32 zone, WorldPacket* packet, WorldSession* self = nullptr, TeamId teamId = TEAM_NEUTRAL);
|
||||||
void SendZoneText(uint32 zone, const char* text, WorldSession* self = 0, TeamId teamId = TEAM_NEUTRAL);
|
void SendZoneText(uint32 zone, const char* text, WorldSession* self = nullptr, TeamId teamId = TEAM_NEUTRAL);
|
||||||
void SendServerMessage(ServerMessageType type, const char* text = "", Player* player = nullptr);
|
void SendServerMessage(ServerMessageType type, const char* text = "", Player* player = nullptr);
|
||||||
|
|
||||||
/// Are we in the middle of a shutdown?
|
/// Are we in the middle of a shutdown?
|
||||||
|
|||||||
@@ -148,11 +148,11 @@ ssize_t RealmSocket::noblk_send(ACE_Message_Block& message_block)
|
|||||||
|
|
||||||
bool RealmSocket::send(const char* buf, size_t len)
|
bool RealmSocket::send(const char* buf, size_t len)
|
||||||
{
|
{
|
||||||
if (buf == NULL || len == 0)
|
if (buf == nullptr || len == 0)
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
ACE_Data_Block db(len, ACE_Message_Block::MB_DATA, (const char*)buf, 0, 0, ACE_Message_Block::DONT_DELETE, 0);
|
ACE_Data_Block db(len, ACE_Message_Block::MB_DATA, (const char*)buf, nullptr, nullptr, ACE_Message_Block::DONT_DELETE, nullptr);
|
||||||
ACE_Message_Block message_block(&db, ACE_Message_Block::DONT_DELETE, 0);
|
ACE_Message_Block message_block(&db, ACE_Message_Block::DONT_DELETE, nullptr);
|
||||||
|
|
||||||
message_block.wr_ptr(len);
|
message_block.wr_ptr(len);
|
||||||
|
|
||||||
@@ -191,7 +191,7 @@ int RealmSocket::handle_output(ACE_HANDLE)
|
|||||||
if (closing_)
|
if (closing_)
|
||||||
return -1;
|
return -1;
|
||||||
|
|
||||||
ACE_Message_Block* mb = 0;
|
ACE_Message_Block* mb = nullptr;
|
||||||
|
|
||||||
if (msg_queue()->is_empty())
|
if (msg_queue()->is_empty())
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -34,7 +34,7 @@ bool isHole(int holes, int i, int j)
|
|||||||
//
|
//
|
||||||
ADT_file::ADT_file()
|
ADT_file::ADT_file()
|
||||||
{
|
{
|
||||||
a_grid = 0;
|
a_grid = nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
ADT_file::~ADT_file()
|
ADT_file::~ADT_file()
|
||||||
@@ -44,7 +44,7 @@ ADT_file::~ADT_file()
|
|||||||
|
|
||||||
void ADT_file::free()
|
void ADT_file::free()
|
||||||
{
|
{
|
||||||
a_grid = 0;
|
a_grid = nullptr;
|
||||||
FileLoader::free();
|
FileLoader::free();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -126,13 +126,13 @@ public:
|
|||||||
{
|
{
|
||||||
if (offsMCVT)
|
if (offsMCVT)
|
||||||
return (adt_MCVT*)((uint8*)this + offsMCVT);
|
return (adt_MCVT*)((uint8*)this + offsMCVT);
|
||||||
return 0;
|
return nullptr;
|
||||||
}
|
}
|
||||||
adt_MCLQ* getMCLQ()
|
adt_MCLQ* getMCLQ()
|
||||||
{
|
{
|
||||||
if (offsMCLQ)
|
if (offsMCLQ)
|
||||||
return (adt_MCLQ*)((uint8*)this + offsMCLQ);
|
return (adt_MCLQ*)((uint8*)this + offsMCLQ);
|
||||||
return 0;
|
return nullptr;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -162,7 +162,7 @@ public:
|
|||||||
{
|
{
|
||||||
if (cells[x][y].offsMCNK)
|
if (cells[x][y].offsMCNK)
|
||||||
return (adt_MCNK*)((uint8*)this + cells[x][y].offsMCNK - 84);
|
return (adt_MCNK*)((uint8*)this + cells[x][y].offsMCNK - 84);
|
||||||
return 0;
|
return nullptr;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -209,42 +209,42 @@ public:
|
|||||||
{
|
{
|
||||||
if (liquid[x][y].used && liquid[x][y].offsData1)
|
if (liquid[x][y].used && liquid[x][y].offsData1)
|
||||||
return (adt_liquid_header*)((uint8*)this + 8 + liquid[x][y].offsData1);
|
return (adt_liquid_header*)((uint8*)this + 8 + liquid[x][y].offsData1);
|
||||||
return 0;
|
return nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
float* getLiquidHeightMap(adt_liquid_header* h)
|
float* getLiquidHeightMap(adt_liquid_header* h)
|
||||||
{
|
{
|
||||||
if (h->formatFlags & ADT_LIQUID_HEADER_NO_HIGHT)
|
if (h->formatFlags & ADT_LIQUID_HEADER_NO_HIGHT)
|
||||||
return 0;
|
return nullptr;
|
||||||
if (h->offsData2b)
|
if (h->offsData2b)
|
||||||
return (float*)((uint8*)this + 8 + h->offsData2b);
|
return (float*)((uint8*)this + 8 + h->offsData2b);
|
||||||
return 0;
|
return nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
uint8* getLiquidLightMap(adt_liquid_header* h)
|
uint8* getLiquidLightMap(adt_liquid_header* h)
|
||||||
{
|
{
|
||||||
if (h->formatFlags & ADT_LIQUID_HEADER_FULL_LIGHT)
|
if (h->formatFlags & ADT_LIQUID_HEADER_FULL_LIGHT)
|
||||||
return 0;
|
return nullptr;
|
||||||
if (h->offsData2b)
|
if (h->offsData2b)
|
||||||
{
|
{
|
||||||
if (h->formatFlags & ADT_LIQUID_HEADER_NO_HIGHT)
|
if (h->formatFlags & ADT_LIQUID_HEADER_NO_HIGHT)
|
||||||
return (uint8*)((uint8*)this + 8 + h->offsData2b);
|
return (uint8*)((uint8*)this + 8 + h->offsData2b);
|
||||||
return (uint8*)((uint8*)this + 8 + h->offsData2b + (h->width + 1) * (h->height + 1) * 4);
|
return (uint8*)((uint8*)this + 8 + h->offsData2b + (h->width + 1) * (h->height + 1) * 4);
|
||||||
}
|
}
|
||||||
return 0;
|
return nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
uint32* getLiquidFullLightMap(adt_liquid_header* h)
|
uint32* getLiquidFullLightMap(adt_liquid_header* h)
|
||||||
{
|
{
|
||||||
if (!(h->formatFlags & ADT_LIQUID_HEADER_FULL_LIGHT))
|
if (!(h->formatFlags & ADT_LIQUID_HEADER_FULL_LIGHT))
|
||||||
return 0;
|
return nullptr;
|
||||||
if (h->offsData2b)
|
if (h->offsData2b)
|
||||||
{
|
{
|
||||||
if (h->formatFlags & ADT_LIQUID_HEADER_NO_HIGHT)
|
if (h->formatFlags & ADT_LIQUID_HEADER_NO_HIGHT)
|
||||||
return (uint32*)((uint8*)this + 8 + h->offsData2b);
|
return (uint32*)((uint8*)this + 8 + h->offsData2b);
|
||||||
return (uint32*)((uint8*)this + 8 + h->offsData2b + (h->width + 1) * (h->height + 1) * 4);
|
return (uint32*)((uint8*)this + 8 + h->offsData2b + (h->width + 1) * (h->height + 1) * 4);
|
||||||
}
|
}
|
||||||
return 0;
|
return nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
uint64 getLiquidShowMap(adt_liquid_header* h)
|
uint64 getLiquidShowMap(adt_liquid_header* h)
|
||||||
|
|||||||
@@ -16,9 +16,9 @@ u_map_fcc MverMagic = { {'R', 'E', 'V', 'M'} };
|
|||||||
|
|
||||||
FileLoader::FileLoader()
|
FileLoader::FileLoader()
|
||||||
{
|
{
|
||||||
data = 0;
|
data = nullptr;
|
||||||
data_size = 0;
|
data_size = 0;
|
||||||
version = 0;
|
version = nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
FileLoader::~FileLoader()
|
FileLoader::~FileLoader()
|
||||||
@@ -65,7 +65,7 @@ bool FileLoader::prepareLoadedData()
|
|||||||
void FileLoader::free()
|
void FileLoader::free()
|
||||||
{
|
{
|
||||||
delete[] data;
|
delete[] data;
|
||||||
data = 0;
|
data = nullptr;
|
||||||
data_size = 0;
|
data_size = 0;
|
||||||
version = 0;
|
version = nullptr;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -50,7 +50,7 @@ void MPQArchive::close()
|
|||||||
|
|
||||||
MPQFile::MPQFile(const char* filename):
|
MPQFile::MPQFile(const char* filename):
|
||||||
eof(false),
|
eof(false),
|
||||||
buffer(0),
|
buffer(nullptr),
|
||||||
pointer(0),
|
pointer(0),
|
||||||
size(0)
|
size(0)
|
||||||
{
|
{
|
||||||
@@ -68,7 +68,7 @@ MPQFile::MPQFile(const char* filename):
|
|||||||
{
|
{
|
||||||
// printf("warning: file %s has size %d; cannot read.\n", filename, size);
|
// printf("warning: file %s has size %d; cannot read.\n", filename, size);
|
||||||
eof = true;
|
eof = true;
|
||||||
buffer = 0;
|
buffer = nullptr;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
buffer = new char[size];
|
buffer = new char[size];
|
||||||
@@ -80,7 +80,7 @@ MPQFile::MPQFile(const char* filename):
|
|||||||
|
|
||||||
}
|
}
|
||||||
eof = true;
|
eof = true;
|
||||||
buffer = 0;
|
buffer = nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
size_t MPQFile::read(void* dest, size_t bytes)
|
size_t MPQFile::read(void* dest, size_t bytes)
|
||||||
@@ -116,6 +116,6 @@ void MPQFile::seekRelative(int offset)
|
|||||||
void MPQFile::close()
|
void MPQFile::close()
|
||||||
{
|
{
|
||||||
delete[] buffer;
|
delete[] buffer;
|
||||||
buffer = 0;
|
buffer = nullptr;
|
||||||
eof = true;
|
eof = true;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -35,9 +35,9 @@ bool wdt_MAIN::prepareLoadedData()
|
|||||||
|
|
||||||
WDT_file::WDT_file()
|
WDT_file::WDT_file()
|
||||||
{
|
{
|
||||||
mphd = 0;
|
mphd = nullptr;
|
||||||
main = 0;
|
main = nullptr;
|
||||||
wmo = 0;
|
wmo = nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
WDT_file::~WDT_file()
|
WDT_file::~WDT_file()
|
||||||
@@ -47,9 +47,9 @@ WDT_file::~WDT_file()
|
|||||||
|
|
||||||
void WDT_file::free()
|
void WDT_file::free()
|
||||||
{
|
{
|
||||||
mphd = 0;
|
mphd = nullptr;
|
||||||
main = 0;
|
main = nullptr;
|
||||||
wmo = 0;
|
wmo = nullptr;
|
||||||
FileLoader::free();
|
FileLoader::free();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -12,7 +12,7 @@
|
|||||||
#include <algorithm>
|
#include <algorithm>
|
||||||
#include <cstdio>
|
#include <cstdio>
|
||||||
|
|
||||||
Model::Model(std::string& filename) : filename(filename), vertices(0), indices(0)
|
Model::Model(std::string& filename) : filename(filename), vertices(nullptr), indices(nullptr)
|
||||||
{
|
{
|
||||||
memset(&header, 0, sizeof(header));
|
memset(&header, 0, sizeof(header));
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -50,7 +50,7 @@ void MPQArchive::close()
|
|||||||
|
|
||||||
MPQFile::MPQFile(const char* filename):
|
MPQFile::MPQFile(const char* filename):
|
||||||
eof(false),
|
eof(false),
|
||||||
buffer(0),
|
buffer(nullptr),
|
||||||
pointer(0),
|
pointer(0),
|
||||||
size(0)
|
size(0)
|
||||||
{
|
{
|
||||||
@@ -68,7 +68,7 @@ MPQFile::MPQFile(const char* filename):
|
|||||||
{
|
{
|
||||||
// printf("info: file %s has size %d; considered dummy file.\n", filename, size);
|
// printf("info: file %s has size %d; considered dummy file.\n", filename, size);
|
||||||
eof = true;
|
eof = true;
|
||||||
buffer = 0;
|
buffer = nullptr;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
buffer = new char[size];
|
buffer = new char[size];
|
||||||
@@ -80,7 +80,7 @@ MPQFile::MPQFile(const char* filename):
|
|||||||
|
|
||||||
}
|
}
|
||||||
eof = true;
|
eof = true;
|
||||||
buffer = 0;
|
buffer = nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
size_t MPQFile::read(void* dest, size_t bytes)
|
size_t MPQFile::read(void* dest, size_t bytes)
|
||||||
@@ -116,6 +116,6 @@ void MPQFile::seekRelative(int offset)
|
|||||||
void MPQFile::close()
|
void MPQFile::close()
|
||||||
{
|
{
|
||||||
delete[] buffer;
|
delete[] buffer;
|
||||||
buffer = 0;
|
buffer = nullptr;
|
||||||
eof = true;
|
eof = true;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -53,7 +53,7 @@ typedef struct
|
|||||||
} map_id;
|
} map_id;
|
||||||
|
|
||||||
map_id* map_ids;
|
map_id* map_ids;
|
||||||
uint16* LiqType = 0;
|
uint16* LiqType = nullptr;
|
||||||
uint32 map_count;
|
uint32 map_count;
|
||||||
char output_path[128] = ".";
|
char output_path[128] = ".";
|
||||||
char input_path[1024] = ".";
|
char input_path[1024] = ".";
|
||||||
|
|||||||
@@ -125,8 +125,8 @@ bool WMORoot::ConvertToVMAPRootWmo(FILE* pOutfile)
|
|||||||
}
|
}
|
||||||
|
|
||||||
WMOGroup::WMOGroup(const std::string& filename) :
|
WMOGroup::WMOGroup(const std::string& filename) :
|
||||||
filename(filename), MOPY(0), MOVI(0), MoviEx(0), MOVT(0), MOBA(0), MobaEx(0),
|
filename(filename), MOPY(nullptr), MOVI(nullptr), MoviEx(nullptr), MOVT(nullptr), MOBA(nullptr), MobaEx(nullptr),
|
||||||
hlq(0), LiquEx(0), LiquBytes(0), groupName(0), descGroupName(0), mogpFlags(0),
|
hlq(nullptr), LiquEx(nullptr), LiquBytes(nullptr), groupName(0), descGroupName(0), mogpFlags(0),
|
||||||
moprIdx(0), moprNItems(0), nBatchA(0), nBatchB(0), nBatchC(0), fogIdx(0),
|
moprIdx(0), moprNItems(0), nBatchA(0), nBatchB(0), nBatchC(0), fogIdx(0),
|
||||||
liquidType(0), groupWMOID(0), mopy_size(0), moba_size(0), LiquEx_size(0),
|
liquidType(0), groupWMOID(0), mopy_size(0), moba_size(0), LiquEx_size(0),
|
||||||
nVertices(0), nTriangles(0), liquflags(0)
|
nVertices(0), nTriangles(0), liquflags(0)
|
||||||
|
|||||||
Reference in New Issue
Block a user