refactor(Core): replace NULL with nullptr (#4593)
This commit is contained in:
parent
dbefa17a53
commit
28f1dc5c0c
231 changed files with 923 additions and 923 deletions
|
|
@ -67,7 +67,7 @@ public:
|
|||
uint32 Idx = 0;
|
||||
const T* temp;
|
||||
if (m_obj2Idx.getRemove(&obj, temp, Idx))
|
||||
m_objects[Idx] = NULL;
|
||||
m_objects[Idx] = nullptr;
|
||||
else
|
||||
m_objects_to_push.remove(&obj);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -12,12 +12,12 @@ namespace MMAP
|
|||
{
|
||||
// ######################## MMapFactory ########################
|
||||
// our global singleton copy
|
||||
MMapManager* g_MMapManager = NULL;
|
||||
MMapManager* g_MMapManager = nullptr;
|
||||
bool MMapFactory::forbiddenMaps[1000] = {0};
|
||||
|
||||
MMapManager* MMapFactory::createOrGetMMapManager()
|
||||
{
|
||||
if (g_MMapManager == NULL)
|
||||
if (g_MMapManager == nullptr)
|
||||
g_MMapManager = new MMapManager();
|
||||
|
||||
return g_MMapManager;
|
||||
|
|
@ -43,7 +43,7 @@ namespace MMAP
|
|||
if (g_MMapManager)
|
||||
{
|
||||
delete g_MMapManager;
|
||||
g_MMapManager = NULL;
|
||||
g_MMapManager = nullptr;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -218,7 +218,7 @@ namespace MMAP
|
|||
dtStatus status;
|
||||
{
|
||||
ACORE_WRITE_GUARD(ACE_RW_Thread_Mutex, GetMMapLock(mapId));
|
||||
status = mmap->navMesh->removeTile(tileRef, NULL, NULL);
|
||||
status = mmap->navMesh->removeTile(tileRef, nullptr, nullptr);
|
||||
}
|
||||
|
||||
// unload, and mark as non loaded
|
||||
|
|
@ -266,7 +266,7 @@ namespace MMAP
|
|||
dtStatus status;
|
||||
{
|
||||
ACORE_WRITE_GUARD(ACE_RW_Thread_Mutex, GetMMapLock(mapId));
|
||||
status = mmap->navMesh->removeTile(i->second, NULL, NULL);
|
||||
status = mmap->navMesh->removeTile(i->second, nullptr, nullptr);
|
||||
}
|
||||
|
||||
if (status != DT_SUCCESS)
|
||||
|
|
@ -329,7 +329,7 @@ namespace MMAP
|
|||
//ACORE_READ_GUARD(ACE_RW_Thread_Mutex, MMapManagerLock);
|
||||
|
||||
if (loadedMMaps.find(mapId) == loadedMMaps.end())
|
||||
return NULL;
|
||||
return nullptr;
|
||||
|
||||
return loadedMMaps[mapId]->navMesh;
|
||||
}
|
||||
|
|
@ -340,7 +340,7 @@ namespace MMAP
|
|||
//ACORE_READ_GUARD(ACE_RW_Thread_Mutex, MMapManagerLock);
|
||||
|
||||
if (loadedMMaps.find(mapId) == loadedMMaps.end())
|
||||
return NULL;
|
||||
return nullptr;
|
||||
|
||||
MMapData* mmap = loadedMMaps[mapId];
|
||||
if (mmap->navMeshQueries.find(instanceId) == mmap->navMeshQueries.end())
|
||||
|
|
@ -357,7 +357,7 @@ namespace MMAP
|
|||
{
|
||||
dtFreeNavMeshQuery(query);
|
||||
sLog->outError("MMAP:GetNavMeshQuery: Failed to initialize dtNavMeshQuery for mapId %03u instanceId %u", mapId, instanceId);
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS)
|
||||
|
|
|
|||
|
|
@ -9,7 +9,7 @@
|
|||
|
||||
namespace VMAP
|
||||
{
|
||||
IVMapManager* gVMapManager = NULL;
|
||||
IVMapManager* gVMapManager = nullptr;
|
||||
|
||||
//===============================================
|
||||
// just return the instance
|
||||
|
|
@ -25,6 +25,6 @@ namespace VMAP
|
|||
void VMapFactory::clear()
|
||||
{
|
||||
delete gVMapManager;
|
||||
gVMapManager = NULL;
|
||||
gVMapManager = nullptr;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -137,7 +137,7 @@ namespace VMAP
|
|||
bool VMapManager2::isInLineOfSight(unsigned int mapId, float x1, float y1, float z1, float x2, float y2, float z2)
|
||||
{
|
||||
#if defined(ENABLE_EXTRAS) && defined(ENABLE_VMAP_CHECKS)
|
||||
if (!isLineOfSightCalcEnabled() || DisableMgr::IsDisabledFor(DISABLE_TYPE_VMAP, mapId, NULL, VMAP_DISABLE_LOS))
|
||||
if (!isLineOfSightCalcEnabled() || DisableMgr::IsDisabledFor(DISABLE_TYPE_VMAP, mapId, nullptr, VMAP_DISABLE_LOS))
|
||||
return true;
|
||||
#endif
|
||||
|
||||
|
|
@ -162,7 +162,7 @@ namespace VMAP
|
|||
bool VMapManager2::getObjectHitPos(unsigned int mapId, float x1, float y1, float z1, float x2, float y2, float z2, float& rx, float& ry, float& rz, float modifyDist)
|
||||
{
|
||||
#if defined(ENABLE_EXTRAS) && defined(ENABLE_VMAP_CHECKS)
|
||||
if (isLineOfSightCalcEnabled() && !DisableMgr::IsDisabledFor(DISABLE_TYPE_VMAP, mapId, NULL, VMAP_DISABLE_LOS))
|
||||
if (isLineOfSightCalcEnabled() && !DisableMgr::IsDisabledFor(DISABLE_TYPE_VMAP, mapId, nullptr, VMAP_DISABLE_LOS))
|
||||
#endif
|
||||
{
|
||||
InstanceTreeMap::iterator instanceTree = iInstanceMapTrees.find(mapId);
|
||||
|
|
@ -194,7 +194,7 @@ namespace VMAP
|
|||
float VMapManager2::getHeight(unsigned int mapId, float x, float y, float z, float maxSearchDist)
|
||||
{
|
||||
#if defined(ENABLE_EXTRAS) && defined(ENABLE_VMAP_CHECKS)
|
||||
if (isHeightCalcEnabled() && !DisableMgr::IsDisabledFor(DISABLE_TYPE_VMAP, mapId, NULL, VMAP_DISABLE_HEIGHT))
|
||||
if (isHeightCalcEnabled() && !DisableMgr::IsDisabledFor(DISABLE_TYPE_VMAP, mapId, nullptr, VMAP_DISABLE_HEIGHT))
|
||||
#endif
|
||||
{
|
||||
InstanceTreeMap::iterator instanceTree = iInstanceMapTrees.find(mapId);
|
||||
|
|
@ -215,7 +215,7 @@ namespace VMAP
|
|||
bool VMapManager2::getAreaInfo(unsigned int mapId, float x, float y, float& z, uint32& flags, int32& adtId, int32& rootId, int32& groupId) const
|
||||
{
|
||||
#if defined(ENABLE_EXTRAS) && defined(ENABLE_VMAP_CHECKS)
|
||||
if (!DisableMgr::IsDisabledFor(DISABLE_TYPE_VMAP, mapId, NULL, VMAP_DISABLE_AREAFLAG))
|
||||
if (!DisableMgr::IsDisabledFor(DISABLE_TYPE_VMAP, mapId, nullptr, VMAP_DISABLE_AREAFLAG))
|
||||
#endif
|
||||
{
|
||||
InstanceTreeMap::const_iterator instanceTree = iInstanceMapTrees.find(mapId);
|
||||
|
|
@ -235,7 +235,7 @@ namespace VMAP
|
|||
bool VMapManager2::GetLiquidLevel(uint32 mapId, float x, float y, float z, uint8 reqLiquidType, float& level, float& floor, uint32& type) const
|
||||
{
|
||||
#if defined(ENABLE_EXTRAS) && defined(ENABLE_VMAP_CHECKS)
|
||||
if (!DisableMgr::IsDisabledFor(DISABLE_TYPE_VMAP, mapId, NULL, VMAP_DISABLE_LIQUIDSTATUS))
|
||||
if (!DisableMgr::IsDisabledFor(DISABLE_TYPE_VMAP, mapId, nullptr, VMAP_DISABLE_LIQUIDSTATUS))
|
||||
#endif
|
||||
{
|
||||
InstanceTreeMap::const_iterator instanceTree = iInstanceMapTrees.find(mapId);
|
||||
|
|
@ -272,7 +272,7 @@ namespace VMAP
|
|||
{
|
||||
sLog->outError("VMapManager2: could not load '%s%s.vmo'", basepath.c_str(), filename.c_str());
|
||||
delete worldmodel;
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS)
|
||||
sLog->outDebug(LOG_FILTER_MAPS, "VMapManager2: loading file '%s%s'", basepath.c_str(), filename.c_str());
|
||||
|
|
|
|||
|
|
@ -41,7 +41,7 @@ namespace VMAP
|
|||
//=================================================================
|
||||
|
||||
TileAssembler::TileAssembler(const std::string& pSrcDirName, const std::string& pDestDirName)
|
||||
: iDestDir(pDestDirName), iSrcDir(pSrcDirName), iFilterMethod(NULL), iCurrentUniqueNameId(0)
|
||||
: iDestDir(pDestDirName), iSrcDir(pSrcDirName), iFilterMethod(nullptr), iCurrentUniqueNameId(0)
|
||||
{
|
||||
//mkdir(iDestDir);
|
||||
//init();
|
||||
|
|
|
|||
|
|
@ -140,13 +140,13 @@ GameObjectModel* GameObjectModel::Create(const GameObject& go)
|
|||
{
|
||||
const GameObjectDisplayInfoEntry* info = sGameObjectDisplayInfoStore.LookupEntry(go.GetDisplayId());
|
||||
if (!info)
|
||||
return NULL;
|
||||
return nullptr;
|
||||
|
||||
GameObjectModel* mdl = new GameObjectModel();
|
||||
if (!mdl->initialize(go, *info))
|
||||
{
|
||||
delete mdl;
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
return mdl;
|
||||
|
|
|
|||
|
|
@ -314,7 +314,7 @@ namespace VMAP
|
|||
triangles.clear();
|
||||
vertices.clear();
|
||||
delete iLiquid;
|
||||
iLiquid = NULL;
|
||||
iLiquid = nullptr;
|
||||
|
||||
if (result && fread(&iBound, sizeof(G3D::AABox), 1, rf) != 1) result = false;
|
||||
if (result && fread(&iMogpFlags, sizeof(uint32), 1, rf) != 1) result = false;
|
||||
|
|
|
|||
|
|
@ -124,7 +124,7 @@ inline float finiteAlways(float f) { return isfinite(f) ? f : 0.0f; }
|
|||
|
||||
inline bool myisfinite(float f) { return isfinite(f) && !isnan(f); }
|
||||
|
||||
#define atol(a) strtoul( a, NULL, 10)
|
||||
#define atol(a) strtoul( a, nullptr, 10)
|
||||
|
||||
#define STRINGIZE(a) #a
|
||||
|
||||
|
|
|
|||
|
|
@ -99,7 +99,7 @@ BigNumber BigNumber::operator/=(BigNumber const& bn)
|
|||
BN_CTX* bnctx;
|
||||
|
||||
bnctx = BN_CTX_new();
|
||||
BN_div(_bn, NULL, _bn, bn._bn, bnctx);
|
||||
BN_div(_bn, nullptr, _bn, bn._bn, bnctx);
|
||||
BN_CTX_free(bnctx);
|
||||
|
||||
return *this;
|
||||
|
|
|
|||
|
|
@ -34,7 +34,7 @@ bool BasicStatementTask::Execute()
|
|||
if (!result || !result->GetRowCount())
|
||||
{
|
||||
delete result;
|
||||
m_result.set(QueryResult(NULL));
|
||||
m_result.set(QueryResult(nullptr));
|
||||
return false;
|
||||
}
|
||||
result->NextRow();
|
||||
|
|
|
|||
|
|
@ -23,7 +23,7 @@ int DatabaseWorker::svc()
|
|||
if (!m_queue)
|
||||
return -1;
|
||||
|
||||
SQLOperation* request = NULL;
|
||||
SQLOperation* request = nullptr;
|
||||
while (1)
|
||||
{
|
||||
request = (SQLOperation*)(m_queue->dequeue());
|
||||
|
|
|
|||
|
|
@ -149,7 +149,7 @@ QueryResult DatabaseWorkerPool<T>::Query(const char* sql, T* conn /* = nullptr*/
|
|||
if (!result || !result->GetRowCount())
|
||||
{
|
||||
delete result;
|
||||
return QueryResult(NULL);
|
||||
return QueryResult(nullptr);
|
||||
}
|
||||
|
||||
result->NextRow();
|
||||
|
|
@ -169,7 +169,7 @@ PreparedQueryResult DatabaseWorkerPool<T>::Query(PreparedStatement* stmt)
|
|||
if (!ret || !ret->GetRowCount())
|
||||
{
|
||||
delete ret;
|
||||
return PreparedQueryResult(NULL);
|
||||
return PreparedQueryResult(nullptr);
|
||||
}
|
||||
|
||||
return PreparedQueryResult(ret);
|
||||
|
|
|
|||
|
|
@ -8,7 +8,7 @@
|
|||
|
||||
Field::Field()
|
||||
{
|
||||
data.value = NULL;
|
||||
data.value = nullptr;
|
||||
data.type = MYSQL_TYPE_NULL;
|
||||
data.length = 0;
|
||||
data.raw = false;
|
||||
|
|
|
|||
|
|
@ -219,7 +219,7 @@ public:
|
|||
if (IsNumeric())
|
||||
{
|
||||
sLog->outSQLDriver("Error: GetCString() on numeric field. Using type: %s.", FieldTypeToString(data.type));
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
#endif
|
||||
return static_cast<char const*>(data.value);
|
||||
|
|
@ -381,7 +381,7 @@ private:
|
|||
case MYSQL_TYPE_NEWDATE:
|
||||
return "NEWDATE";
|
||||
case MYSQL_TYPE_NULL:
|
||||
return "NULL";
|
||||
return "nullptr";
|
||||
case MYSQL_TYPE_SET:
|
||||
return "SET";
|
||||
case MYSQL_TYPE_SHORT:
|
||||
|
|
|
|||
|
|
@ -26,9 +26,9 @@
|
|||
MySQLConnection::MySQLConnection(MySQLConnectionInfo& connInfo) :
|
||||
m_reconnecting(false),
|
||||
m_prepareError(false),
|
||||
m_queue(NULL),
|
||||
m_worker(NULL),
|
||||
m_Mysql(NULL),
|
||||
m_queue(nullptr),
|
||||
m_worker(nullptr),
|
||||
m_Mysql(nullptr),
|
||||
m_connectionInfo(connInfo),
|
||||
m_connectionFlags(CONNECTION_SYNCH)
|
||||
{
|
||||
|
|
@ -38,7 +38,7 @@ MySQLConnection::MySQLConnection(ACE_Activation_Queue* queue, MySQLConnectionInf
|
|||
m_reconnecting(false),
|
||||
m_prepareError(false),
|
||||
m_queue(queue),
|
||||
m_Mysql(NULL),
|
||||
m_Mysql(nullptr),
|
||||
m_connectionInfo(connInfo),
|
||||
m_connectionFlags(CONNECTION_ASYNC)
|
||||
{
|
||||
|
|
@ -64,7 +64,7 @@ void MySQLConnection::Close()
|
|||
bool MySQLConnection::Open()
|
||||
{
|
||||
MYSQL* mysqlInit;
|
||||
mysqlInit = mysql_init(NULL);
|
||||
mysqlInit = mysql_init(nullptr);
|
||||
if (!mysqlInit)
|
||||
{
|
||||
sLog->outError("Could not initialize Mysql connection to database `%s`", m_connectionInfo.database.c_str());
|
||||
|
|
@ -313,15 +313,15 @@ bool MySQLConnection::_Query(PreparedStatement* stmt, MYSQL_RES** pResult, uint6
|
|||
ResultSet* MySQLConnection::Query(const char* sql)
|
||||
{
|
||||
if (!sql)
|
||||
return NULL;
|
||||
return nullptr;
|
||||
|
||||
MYSQL_RES* result = NULL;
|
||||
MYSQL_FIELD* fields = NULL;
|
||||
MYSQL_RES* result = nullptr;
|
||||
MYSQL_FIELD* fields = nullptr;
|
||||
uint64 rowCount = 0;
|
||||
uint32 fieldCount = 0;
|
||||
|
||||
if (!_Query(sql, &result, &fields, &rowCount, &fieldCount))
|
||||
return NULL;
|
||||
return nullptr;
|
||||
|
||||
return new ResultSet(result, fields, rowCount, fieldCount);
|
||||
}
|
||||
|
|
@ -460,7 +460,7 @@ void MySQLConnection::PrepareStatement(uint32 index, const char* sql, Connection
|
|||
// to save memory that will not be used.
|
||||
if (!(m_connectionFlags & flags))
|
||||
{
|
||||
m_stmts[index] = NULL;
|
||||
m_stmts[index] = nullptr;
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
@ -490,12 +490,12 @@ void MySQLConnection::PrepareStatement(uint32 index, const char* sql, Connection
|
|||
|
||||
PreparedResultSet* MySQLConnection::Query(PreparedStatement* stmt)
|
||||
{
|
||||
MYSQL_RES* result = NULL;
|
||||
MYSQL_RES* result = nullptr;
|
||||
uint64 rowCount = 0;
|
||||
uint32 fieldCount = 0;
|
||||
|
||||
if (!_Query(stmt, &result, &rowCount, &fieldCount))
|
||||
return NULL;
|
||||
return nullptr;
|
||||
|
||||
if (mysql_more_results(m_Mysql))
|
||||
{
|
||||
|
|
|
|||
|
|
@ -9,7 +9,7 @@
|
|||
#include "Log.h"
|
||||
|
||||
PreparedStatement::PreparedStatement(uint32 index) :
|
||||
m_stmt(NULL),
|
||||
m_stmt(nullptr),
|
||||
m_index(index)
|
||||
{
|
||||
}
|
||||
|
|
@ -192,9 +192,9 @@ void PreparedStatement::setNull(const uint8 index)
|
|||
}
|
||||
|
||||
MySQLPreparedStatement::MySQLPreparedStatement(MYSQL_STMT* stmt) :
|
||||
m_stmt(NULL),
|
||||
m_stmt(nullptr),
|
||||
m_Mstmt(stmt),
|
||||
m_bind(NULL)
|
||||
m_bind(nullptr)
|
||||
{
|
||||
/// Initialize variable parameters
|
||||
m_paramCount = mysql_stmt_param_count(stmt);
|
||||
|
|
@ -224,9 +224,9 @@ void MySQLPreparedStatement::ClearParameters()
|
|||
for (uint32 i = 0; i < m_paramCount; ++i)
|
||||
{
|
||||
delete m_bind[i].length;
|
||||
m_bind[i].length = NULL;
|
||||
m_bind[i].length = nullptr;
|
||||
delete[] (char*) m_bind[i].buffer;
|
||||
m_bind[i].buffer = NULL;
|
||||
m_bind[i].buffer = nullptr;
|
||||
m_paramsSet[i] = false;
|
||||
}
|
||||
}
|
||||
|
|
@ -356,11 +356,11 @@ void MySQLPreparedStatement::setNull(const uint8 index)
|
|||
MYSQL_BIND* param = &m_bind[index];
|
||||
param->buffer_type = MYSQL_TYPE_NULL;
|
||||
delete [] static_cast<char*>(param->buffer);
|
||||
param->buffer = NULL;
|
||||
param->buffer = nullptr;
|
||||
param->buffer_length = 0;
|
||||
param->is_null_value = 1;
|
||||
delete param->length;
|
||||
param->length = NULL;
|
||||
param->length = nullptr;
|
||||
}
|
||||
|
||||
void MySQLPreparedStatement::setValue(MYSQL_BIND* param, enum_field_types type, const void* value, uint32 len, bool isUnsigned)
|
||||
|
|
@ -370,7 +370,7 @@ void MySQLPreparedStatement::setValue(MYSQL_BIND* param, enum_field_types type,
|
|||
param->buffer = new char[len];
|
||||
param->buffer_length = 0;
|
||||
param->is_null_value = 0;
|
||||
param->length = NULL; // Only != NULL for strings
|
||||
param->length = nullptr; // Only != nullptr for strings
|
||||
param->is_unsigned = isUnsigned;
|
||||
|
||||
memcpy(param->buffer, value, len);
|
||||
|
|
@ -425,7 +425,7 @@ std::string MySQLPreparedStatement::getQueryString(std::string const& sqlPattern
|
|||
ss << '\'' << m_stmt->statement_data[i].str << '\'';
|
||||
break;
|
||||
case TYPE_NULL:
|
||||
ss << "NULL";
|
||||
ss << "nullptr";
|
||||
break;
|
||||
}
|
||||
|
||||
|
|
@ -464,7 +464,7 @@ bool PreparedStatementTask::Execute()
|
|||
if (!result || !result->GetRowCount())
|
||||
{
|
||||
delete result;
|
||||
m_result.set(PreparedQueryResult(NULL));
|
||||
m_result.set(PreparedQueryResult(nullptr));
|
||||
return false;
|
||||
}
|
||||
m_result.set(PreparedQueryResult(result));
|
||||
|
|
|
|||
|
|
@ -23,7 +23,7 @@ bool SQLQueryHolder::SetQuery(size_t index, const char* sql)
|
|||
element.element.query = strdup(sql);
|
||||
|
||||
SQLResultSetUnion result;
|
||||
result.qresult = NULL;
|
||||
result.qresult = nullptr;
|
||||
|
||||
m_queries[index] = SQLResultPair(element, result);
|
||||
return true;
|
||||
|
|
@ -66,7 +66,7 @@ bool SQLQueryHolder::SetPreparedQuery(size_t index, PreparedStatement* stmt)
|
|||
element.element.stmt = stmt;
|
||||
|
||||
SQLResultSetUnion result;
|
||||
result.presult = NULL;
|
||||
result.presult = nullptr;
|
||||
|
||||
m_queries[index] = SQLResultPair(element, result);
|
||||
return true;
|
||||
|
|
@ -79,13 +79,13 @@ QueryResult SQLQueryHolder::GetResult(size_t index)
|
|||
{
|
||||
ResultSet* result = m_queries[index].second.qresult;
|
||||
if (!result || !result->GetRowCount())
|
||||
return QueryResult(NULL);
|
||||
return QueryResult(nullptr);
|
||||
|
||||
result->NextRow();
|
||||
return QueryResult(result);
|
||||
}
|
||||
else
|
||||
return QueryResult(NULL);
|
||||
return QueryResult(nullptr);
|
||||
}
|
||||
|
||||
PreparedQueryResult SQLQueryHolder::GetPreparedResult(size_t index)
|
||||
|
|
@ -95,12 +95,12 @@ PreparedQueryResult SQLQueryHolder::GetPreparedResult(size_t index)
|
|||
{
|
||||
PreparedResultSet* result = m_queries[index].second.presult;
|
||||
if (!result || !result->GetRowCount())
|
||||
return PreparedQueryResult(NULL);
|
||||
return PreparedQueryResult(nullptr);
|
||||
|
||||
return PreparedQueryResult(result);
|
||||
}
|
||||
else
|
||||
return PreparedQueryResult(NULL);
|
||||
return PreparedQueryResult(nullptr);
|
||||
}
|
||||
|
||||
void SQLQueryHolder::SetResult(size_t index, ResultSet* result)
|
||||
|
|
@ -108,7 +108,7 @@ void SQLQueryHolder::SetResult(size_t index, ResultSet* result)
|
|||
if (result && !result->GetRowCount())
|
||||
{
|
||||
delete result;
|
||||
result = NULL;
|
||||
result = nullptr;
|
||||
}
|
||||
|
||||
/// store the result in the holder
|
||||
|
|
@ -121,7 +121,7 @@ void SQLQueryHolder::SetPreparedResult(size_t index, PreparedResultSet* result)
|
|||
if (result && !result->GetRowCount())
|
||||
{
|
||||
delete result;
|
||||
result = NULL;
|
||||
result = nullptr;
|
||||
}
|
||||
|
||||
/// store the result in the holder
|
||||
|
|
|
|||
|
|
@ -21,11 +21,11 @@ PreparedResultSet::PreparedResultSet(MYSQL_STMT* stmt, MYSQL_RES* result, uint64
|
|||
m_rowCount(rowCount),
|
||||
m_rowPosition(0),
|
||||
m_fieldCount(fieldCount),
|
||||
m_rBind(NULL),
|
||||
m_rBind(nullptr),
|
||||
m_stmt(stmt),
|
||||
m_res(result),
|
||||
m_isNull(NULL),
|
||||
m_length(NULL)
|
||||
m_isNull(nullptr),
|
||||
m_length(nullptr)
|
||||
{
|
||||
if (!m_res)
|
||||
return;
|
||||
|
|
@ -67,7 +67,7 @@ PreparedResultSet::PreparedResultSet(MYSQL_STMT* stmt, MYSQL_RES* result, uint64
|
|||
m_rBind[i].buffer_length = size;
|
||||
m_rBind[i].length = &m_length[i];
|
||||
m_rBind[i].is_null = &m_isNull[i];
|
||||
m_rBind[i].error = NULL;
|
||||
m_rBind[i].error = nullptr;
|
||||
m_rBind[i].is_unsigned = field->flags & UNSIGNED_FLAG;
|
||||
|
||||
++i;
|
||||
|
|
@ -198,13 +198,13 @@ void ResultSet::CleanUp()
|
|||
if (_currentRow)
|
||||
{
|
||||
delete [] _currentRow;
|
||||
_currentRow = NULL;
|
||||
_currentRow = nullptr;
|
||||
}
|
||||
|
||||
if (_result)
|
||||
{
|
||||
mysql_free_result(_result);
|
||||
_result = NULL;
|
||||
_result = nullptr;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -16,7 +16,7 @@
|
|||
|
||||
@brief This file contains definitions of functions used for reporting critical application errors
|
||||
|
||||
It is very important that (std::)abort is NEVER called in place of *((volatile int*)NULL) = 0;
|
||||
It is very important that (std::)abort is NEVER called in place of *((volatile int*)nullptr) = 0;
|
||||
Calling abort() on Windows does not invoke unhandled exception filters - a mechanism used by WheatyExceptionReport
|
||||
to log crashes. exit(1) calls here are for static analysis tools to indicate that calling functions defined in this file
|
||||
terminates the application.
|
||||
|
|
|
|||
|
|
@ -35,11 +35,11 @@ inline LPTSTR ErrorMessage(DWORD dw)
|
|||
DWORD formatResult = FormatMessage(
|
||||
FORMAT_MESSAGE_ALLOCATE_BUFFER |
|
||||
FORMAT_MESSAGE_FROM_SYSTEM,
|
||||
NULL,
|
||||
nullptr,
|
||||
dw,
|
||||
MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT),
|
||||
(LPTSTR) &lpMsgBuf,
|
||||
0, NULL);
|
||||
0, nullptr);
|
||||
if (formatResult != 0)
|
||||
return (LPTSTR)lpMsgBuf;
|
||||
else
|
||||
|
|
@ -130,7 +130,7 @@ LONG WINAPI WheatyExceptionReport::WheatyUnhandledExceptionFilter(
|
|||
|
||||
TCHAR crash_folder_path[MAX_PATH];
|
||||
sprintf_s(crash_folder_path, "%s\\%s", module_folder_name, CrashFolder);
|
||||
if (!CreateDirectory(crash_folder_path, NULL))
|
||||
if (!CreateDirectory(crash_folder_path, nullptr))
|
||||
{
|
||||
if (GetLastError() != ERROR_ALREADY_EXISTS)
|
||||
return 0;
|
||||
|
|
@ -220,7 +220,7 @@ BOOL WheatyExceptionReport::_GetProcessorName(TCHAR* sProcessorName, DWORD maxco
|
|||
return FALSE;
|
||||
TCHAR szTmp[2048];
|
||||
DWORD cntBytes = sizeof(szTmp);
|
||||
lRet = ::RegQueryValueEx(hKey, _T("ProcessorNameString"), NULL, NULL,
|
||||
lRet = ::RegQueryValueEx(hKey, _T("ProcessorNameString"), nullptr, nullptr,
|
||||
(LPBYTE)szTmp, &cntBytes);
|
||||
if (lRet != ERROR_SUCCESS)
|
||||
return FALSE;
|
||||
|
|
@ -582,7 +582,7 @@ void WheatyExceptionReport::GenerateExceptionReport(
|
|||
|
||||
CONTEXT trashableContext = *pCtx;
|
||||
|
||||
WriteStackDetails(&trashableContext, false, NULL);
|
||||
WriteStackDetails(&trashableContext, false, nullptr);
|
||||
printTracesForAllThreads(false);
|
||||
|
||||
// #ifdef _M_IX86 // X86 Only!
|
||||
|
|
@ -591,7 +591,7 @@ void WheatyExceptionReport::GenerateExceptionReport(
|
|||
Log(_T("Local Variables And Parameters\r\n"));
|
||||
|
||||
trashableContext = *pCtx;
|
||||
WriteStackDetails(&trashableContext, true, NULL);
|
||||
WriteStackDetails(&trashableContext, true, nullptr);
|
||||
printTracesForAllThreads(true);
|
||||
|
||||
SymCleanup(GetCurrentProcess());
|
||||
|
|
@ -764,7 +764,7 @@ void WheatyExceptionReport::WriteStackDetails(
|
|||
// Get the next stack frame
|
||||
if (! StackWalk64(dwMachineType,
|
||||
m_hProcess,
|
||||
pThreadHandle != NULL ? pThreadHandle : GetCurrentThread(),
|
||||
pThreadHandle != nullptr ? pThreadHandle : GetCurrentThread(),
|
||||
&sf,
|
||||
pContext,
|
||||
0,
|
||||
|
|
@ -969,7 +969,7 @@ void WheatyExceptionReport::DumpTypeIndex(
|
|||
char buffer[50];
|
||||
FormatOutputValue(buffer, btStdString, 0, (PVOID)offset, sizeof(buffer));
|
||||
symbolDetails.top().Value = buffer;
|
||||
if (Name != NULL && Name[0] != '\0')
|
||||
if (Name != nullptr && Name[0] != '\0')
|
||||
symbolDetails.top().Name = Name;
|
||||
bHandled = true;
|
||||
return;
|
||||
|
|
@ -978,7 +978,7 @@ void WheatyExceptionReport::DumpTypeIndex(
|
|||
char buffer[WER_SMALL_BUFFER_SIZE];
|
||||
wcstombs(buffer, pwszTypeName, sizeof(buffer));
|
||||
buffer[WER_SMALL_BUFFER_SIZE - 1] = '\0';
|
||||
if (Name != NULL && Name[0] != '\0')
|
||||
if (Name != nullptr && Name[0] != '\0')
|
||||
{
|
||||
symbolDetails.top().Type = buffer;
|
||||
symbolDetails.top().Name = Name;
|
||||
|
|
@ -988,7 +988,7 @@ void WheatyExceptionReport::DumpTypeIndex(
|
|||
|
||||
LocalFree(pwszTypeName);
|
||||
}
|
||||
else if (Name != NULL && Name[0] != '\0')
|
||||
else if (Name != nullptr && Name[0] != '\0')
|
||||
symbolDetails.top().Name = Name;
|
||||
|
||||
if (!StoreSymbol(dwTypeIndex, offset))
|
||||
|
|
@ -1005,7 +1005,7 @@ void WheatyExceptionReport::DumpTypeIndex(
|
|||
case SymTagPointerType:
|
||||
if (SymGetTypeInfo(m_hProcess, modBase, dwTypeIndex, TI_GET_TYPEID, &innerTypeID))
|
||||
{
|
||||
if (Name != NULL && Name[0] != '\0')
|
||||
if (Name != nullptr && Name[0] != '\0')
|
||||
symbolDetails.top().Name = Name;
|
||||
|
||||
BOOL isReference;
|
||||
|
|
@ -1083,7 +1083,7 @@ void WheatyExceptionReport::DumpTypeIndex(
|
|||
offset, bHandled, symbolDetails.top().Name.c_str(), "", false, logChildren);
|
||||
break;
|
||||
case SymTagPointerType:
|
||||
if (Name != NULL && Name[0] != '\0')
|
||||
if (Name != nullptr && Name[0] != '\0')
|
||||
symbolDetails.top().Name = Name;
|
||||
DumpTypeIndex(modBase, innerTypeID,
|
||||
offset, bHandled, symbolDetails.top().Name.c_str(), "", false, logChildren);
|
||||
|
|
|
|||
|
|
@ -28,7 +28,7 @@ public:
|
|||
void DeregisterSelf(void) { FactoryHolderRegistry::instance()->RemoveItem(this, false); }
|
||||
|
||||
/// Abstract Factory create method
|
||||
virtual T* Create(void* data = NULL) const = 0;
|
||||
virtual T* Create(void* data = nullptr) const = 0;
|
||||
private:
|
||||
Key i_key;
|
||||
};
|
||||
|
|
|
|||
|
|
@ -24,9 +24,9 @@ public:
|
|||
[[nodiscard]] Reference<TO, FROM> const* getLast() const { return ((Reference<TO, FROM> const*) LinkedListHead::getLast()); }
|
||||
|
||||
iterator begin() { return iterator(getFirst()); }
|
||||
iterator end() { return iterator(NULL); }
|
||||
iterator end() { return iterator(nullptr); }
|
||||
iterator rbegin() { return iterator(getLast()); }
|
||||
iterator rend() { return iterator(NULL); }
|
||||
iterator rend() { return iterator(nullptr); }
|
||||
|
||||
void clearReferences()
|
||||
{
|
||||
|
|
|
|||
|
|
@ -33,7 +33,7 @@ public:
|
|||
// Create new link
|
||||
void link(TO* toObj, FROM* fromObj)
|
||||
{
|
||||
ASSERT(fromObj); // fromObj MUST not be NULL
|
||||
ASSERT(fromObj); // fromObj MUST not be nullptr
|
||||
if (isValid())
|
||||
unlink();
|
||||
if (toObj != nullptr)
|
||||
|
|
|
|||
|
|
@ -25,7 +25,7 @@ public:
|
|||
const T* GetRegistryItem(Key key) const
|
||||
{
|
||||
typename RegistryMapType::const_iterator iter = i_registeredObjects.find(key);
|
||||
return ( iter == i_registeredObjects.end() ? NULL : iter->second );
|
||||
return ( iter == i_registeredObjects.end() ? nullptr : iter->second );
|
||||
}
|
||||
|
||||
static ObjectRegistry<T, Key>* instance()
|
||||
|
|
|
|||
|
|
@ -86,20 +86,20 @@ template<class OBJECT_TYPES>
|
|||
class TypeMapContainer
|
||||
{
|
||||
public:
|
||||
template<class SPECIFIC_TYPE> [[nodiscard]] size_t Count() const { return acore::Count(i_elements, (SPECIFIC_TYPE*)NULL); }
|
||||
template<class SPECIFIC_TYPE> [[nodiscard]] size_t Count() const { return acore::Count(i_elements, (SPECIFIC_TYPE*)nullptr); }
|
||||
|
||||
/// inserts a specific object into the container
|
||||
template<class SPECIFIC_TYPE> bool insert(SPECIFIC_TYPE* obj)
|
||||
{
|
||||
SPECIFIC_TYPE* t = acore::Insert(i_elements, obj);
|
||||
return (t != NULL);
|
||||
return (t != nullptr);
|
||||
}
|
||||
|
||||
/// Removes the object from the container, and returns the removed object
|
||||
//template<class SPECIFIC_TYPE> bool remove(SPECIFIC_TYPE* obj)
|
||||
//{
|
||||
// SPECIFIC_TYPE* t = acore::Remove(i_elements, obj);
|
||||
// return (t != NULL);
|
||||
// return (t != nullptr);
|
||||
//}
|
||||
|
||||
ContainerMapList<OBJECT_TYPES>& GetElements() { return i_elements; }
|
||||
|
|
|
|||
|
|
@ -56,20 +56,20 @@ namespace acore
|
|||
|
||||
template<class SPECIFIC_TYPE> SPECIFIC_TYPE* Insert(ContainerMapList<TypeNull>& /*elements*/, SPECIFIC_TYPE* /*obj*/)
|
||||
{
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
// this is a missed
|
||||
template<class SPECIFIC_TYPE, class T> SPECIFIC_TYPE* Insert(ContainerMapList<T>& /*elements*/, SPECIFIC_TYPE* /*obj*/)
|
||||
{
|
||||
return NULL; // a missed
|
||||
return nullptr; // a missed
|
||||
}
|
||||
|
||||
// Recursion
|
||||
template<class SPECIFIC_TYPE, class H, class T> SPECIFIC_TYPE* Insert(ContainerMapList<TypeList<H, T>>& elements, SPECIFIC_TYPE* obj)
|
||||
{
|
||||
SPECIFIC_TYPE* t = Insert(elements._elements, obj);
|
||||
return (t != NULL ? t : Insert(elements._TailElements, obj));
|
||||
return (t != nullptr ? t : Insert(elements._TailElements, obj));
|
||||
}
|
||||
|
||||
//// non-const remove method
|
||||
|
|
@ -81,20 +81,20 @@ namespace acore
|
|||
|
||||
//template<class SPECIFIC_TYPE> SPECIFIC_TYPE* Remove(ContainerMapList<TypeNull> &/*elements*/, SPECIFIC_TYPE * /*obj*/)
|
||||
//{
|
||||
// return NULL;
|
||||
// return nullptr;
|
||||
//}
|
||||
|
||||
//// this is a missed
|
||||
//template<class SPECIFIC_TYPE, class T> SPECIFIC_TYPE* Remove(ContainerMapList<T> &/*elements*/, SPECIFIC_TYPE * /*obj*/)
|
||||
//{
|
||||
// return NULL; // a missed
|
||||
// return nullptr; // a missed
|
||||
//}
|
||||
|
||||
//template<class SPECIFIC_TYPE, class T, class H> SPECIFIC_TYPE* Remove(ContainerMapList<TypeList<H, T> > &elements, SPECIFIC_TYPE *obj)
|
||||
//{
|
||||
// // The head element is bad
|
||||
// SPECIFIC_TYPE* t = Remove(elements._elements, obj);
|
||||
// return ( t != NULL ? t : Remove(elements._TailElements, obj) );
|
||||
// return ( t != nullptr ? t : Remove(elements._TailElements, obj) );
|
||||
//}
|
||||
}
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -50,17 +50,17 @@ namespace acore
|
|||
template<class SPECIFIC_TYPE> CountedPtr<SPECIFIC_TYPE>& Find(ContainerMapList<SPECIFIC_TYPE>& elements, OBJECT_HANDLE hdl, CountedPtr<SPECIFIC_TYPE>* /*fake*/)
|
||||
{
|
||||
typename std::map<OBJECT_HANDLE, CountedPtr<SPECIFIC_TYPE>>::iterator iter = elements._element.find(hdl);
|
||||
return (iter == elements._element.end() ? NullPtr<SPECIFIC_TYPE>((SPECIFIC_TYPE*)NULL) : iter->second);
|
||||
return (iter == elements._element.end() ? NullPtr<SPECIFIC_TYPE>((SPECIFIC_TYPE*)nullptr) : iter->second);
|
||||
};
|
||||
|
||||
template<class SPECIFIC_TYPE> CountedPtr<SPECIFIC_TYPE>& Find(ContainerMapList<TypeNull>& elements, OBJECT_HANDLE hdl, CountedPtr<SPECIFIC_TYPE>* /*fake*/)
|
||||
{
|
||||
return NullPtr<SPECIFIC_TYPE>((SPECIFIC_TYPE*)NULL);// terminate recursion
|
||||
return NullPtr<SPECIFIC_TYPE>((SPECIFIC_TYPE*)nullptr);// terminate recursion
|
||||
}
|
||||
|
||||
template<class SPECIFIC_TYPE, class T> CountedPtr<SPECIFIC_TYPE>& Find(ContainerMapList<T>& elements, OBJECT_HANDLE hdl, CountedPtr<SPECIFIC_TYPE>* /*fake*/)
|
||||
{
|
||||
return NullPtr<SPECIFIC_TYPE>((SPECIFIC_TYPE*)NULL);// this is a missed
|
||||
return NullPtr<SPECIFIC_TYPE>((SPECIFIC_TYPE*)nullptr);// this is a missed
|
||||
}
|
||||
|
||||
template<class SPECIFIC_TYPE, class H, class T> CountedPtr<SPECIFIC_TYPE>& Find(ContainerMapList<TypeList<H, T>>& elements, OBJECT_HANDLE hdl, CountedPtr<SPECIFIC_TYPE>* fake)
|
||||
|
|
@ -73,17 +73,17 @@ namespace acore
|
|||
template<class SPECIFIC_TYPE> const CountedPtr<SPECIFIC_TYPE>& Find(const ContainerMapList<SPECIFIC_TYPE>& elements, OBJECT_HANDLE hdl, CountedPtr<SPECIFIC_TYPE>* /*fake*/)
|
||||
{
|
||||
typename CountedPtr<SPECIFIC_TYPE>::iterator iter = elements._element.find(hdl);
|
||||
return (iter == elements._element.end() ? NullPtr<SPECIFIC_TYPE>((SPECIFIC_TYPE*)NULL) : iter->second);
|
||||
return (iter == elements._element.end() ? NullPtr<SPECIFIC_TYPE>((SPECIFIC_TYPE*)nullptr) : iter->second);
|
||||
};
|
||||
|
||||
template<class SPECIFIC_TYPE> const CountedPtr<SPECIFIC_TYPE>& Find(const ContainerMapList<TypeNull>& elements, OBJECT_HANDLE hdl, CountedPtr<SPECIFIC_TYPE>* /*fake*/)
|
||||
{
|
||||
return NullPtr<SPECIFIC_TYPE>((SPECIFIC_TYPE*)NULL);
|
||||
return NullPtr<SPECIFIC_TYPE>((SPECIFIC_TYPE*)nullptr);
|
||||
}
|
||||
|
||||
template<class SPECIFIC_TYPE, class T> const CountedPtr<SPECIFIC_TYPE>& Find(const ContainerMapList<T>& elements, OBJECT_HANDLE hdl, CountedPtr<SPECIFIC_TYPE>* /*fake*/)
|
||||
{
|
||||
return NullPtr<SPECIFIC_TYPE>((SPECIFIC_TYPE*)NULL);
|
||||
return NullPtr<SPECIFIC_TYPE>((SPECIFIC_TYPE*)nullptr);
|
||||
}
|
||||
|
||||
template<class SPECIFIC_TYPE, class H, class T> CountedPtr<SPECIFIC_TYPE>& Find(const ContainerMapList<TypeList<H, T>>& elements, OBJECT_HANDLE hdl, CountedPtr<SPECIFIC_TYPE>* fake)
|
||||
|
|
@ -104,13 +104,13 @@ namespace acore
|
|||
|
||||
template<class SPECIFIC_TYPE> CountedPtr<SPECIFIC_TYPE>& Insert(ContainerMapList<TypeNull>& elements, CountedPtr<SPECIFIC_TYPE>& obj, OBJECT_HANDLE hdl)
|
||||
{
|
||||
return NullPtr<SPECIFIC_TYPE>((SPECIFIC_TYPE*)NULL);
|
||||
return NullPtr<SPECIFIC_TYPE>((SPECIFIC_TYPE*)nullptr);
|
||||
}
|
||||
|
||||
// this is a missed
|
||||
template<class SPECIFIC_TYPE, class T> CountedPtr<SPECIFIC_TYPE>& Insert(ContainerMapList<T>& elements, CountedPtr<SPECIFIC_TYPE>& obj, OBJECT_HANDLE hdl)
|
||||
{
|
||||
return NullPtr<SPECIFIC_TYPE>((SPECIFIC_TYPE*)NULL);// a missed
|
||||
return NullPtr<SPECIFIC_TYPE>((SPECIFIC_TYPE*)nullptr);// a missed
|
||||
}
|
||||
|
||||
// Recursion
|
||||
|
|
|
|||
|
|
@ -18,8 +18,8 @@ extern LoginDatabaseWorkerPool LoginDatabase;
|
|||
#include <stdio.h>
|
||||
|
||||
Log::Log() :
|
||||
raLogfile(NULL), logfile(NULL), gmLogfile(NULL), charLogfile(NULL),
|
||||
dberLogfile(NULL), chatLogfile(NULL), sqlLogFile(NULL), sqlDevLogFile(NULL), miscLogFile(NULL),
|
||||
raLogfile(nullptr), logfile(nullptr), gmLogfile(nullptr), charLogfile(nullptr),
|
||||
dberLogfile(nullptr), chatLogfile(nullptr), sqlLogFile(nullptr), sqlDevLogFile(nullptr), miscLogFile(nullptr),
|
||||
m_gmlog_per_account(false), m_enableLogDB(false), m_colored(false)
|
||||
{
|
||||
Initialize();
|
||||
|
|
@ -27,41 +27,41 @@ Log::Log() :
|
|||
|
||||
Log::~Log()
|
||||
{
|
||||
if (logfile != NULL)
|
||||
if (logfile != nullptr)
|
||||
fclose(logfile);
|
||||
logfile = NULL;
|
||||
logfile = nullptr;
|
||||
|
||||
if (gmLogfile != NULL)
|
||||
if (gmLogfile != nullptr)
|
||||
fclose(gmLogfile);
|
||||
gmLogfile = NULL;
|
||||
gmLogfile = nullptr;
|
||||
|
||||
if (charLogfile != NULL)
|
||||
if (charLogfile != nullptr)
|
||||
fclose(charLogfile);
|
||||
charLogfile = NULL;
|
||||
charLogfile = nullptr;
|
||||
|
||||
if (dberLogfile != NULL)
|
||||
if (dberLogfile != nullptr)
|
||||
fclose(dberLogfile);
|
||||
dberLogfile = NULL;
|
||||
dberLogfile = nullptr;
|
||||
|
||||
if (raLogfile != NULL)
|
||||
if (raLogfile != nullptr)
|
||||
fclose(raLogfile);
|
||||
raLogfile = NULL;
|
||||
raLogfile = nullptr;
|
||||
|
||||
if (chatLogfile != NULL)
|
||||
if (chatLogfile != nullptr)
|
||||
fclose(chatLogfile);
|
||||
chatLogfile = NULL;
|
||||
chatLogfile = nullptr;
|
||||
|
||||
if (sqlLogFile != NULL)
|
||||
if (sqlLogFile != nullptr)
|
||||
fclose(sqlLogFile);
|
||||
sqlLogFile = NULL;
|
||||
sqlLogFile = nullptr;
|
||||
|
||||
if (sqlDevLogFile != NULL)
|
||||
if (sqlDevLogFile != nullptr)
|
||||
fclose(sqlDevLogFile);
|
||||
sqlDevLogFile = NULL;
|
||||
sqlDevLogFile = nullptr;
|
||||
|
||||
if (miscLogFile != NULL)
|
||||
if (miscLogFile != nullptr)
|
||||
fclose(miscLogFile);
|
||||
miscLogFile = NULL;
|
||||
miscLogFile = nullptr;
|
||||
}
|
||||
|
||||
std::unique_ptr<ILog>& getLogInstance()
|
||||
|
|
@ -145,11 +145,11 @@ void Log::Initialize()
|
|||
}
|
||||
|
||||
charLogfile = openLogFile("CharLogFile", "CharLogTimestamp", "a");
|
||||
dberLogfile = openLogFile("DBErrorLogFile", NULL, "a");
|
||||
raLogfile = openLogFile("RaLogFile", NULL, "a");
|
||||
dberLogfile = openLogFile("DBErrorLogFile", nullptr, "a");
|
||||
raLogfile = openLogFile("RaLogFile", nullptr, "a");
|
||||
chatLogfile = openLogFile("ChatLogFile", "ChatLogTimestamp", "a");
|
||||
sqlLogFile = openLogFile("SQLDriverLogFile", NULL, "a");
|
||||
sqlDevLogFile = openLogFile("SQLDeveloperLogFile", NULL, "a");
|
||||
sqlLogFile = openLogFile("SQLDriverLogFile", nullptr, "a");
|
||||
sqlDevLogFile = openLogFile("SQLDeveloperLogFile", nullptr, "a");
|
||||
miscLogFile = fopen((m_logsDir + "Misc.log").c_str(), "a");
|
||||
|
||||
// Main log file settings
|
||||
|
|
@ -185,7 +185,7 @@ FILE* Log::openLogFile(char const* configFileName, char const* configTimeStampFl
|
|||
{
|
||||
std::string logfn = sConfigMgr->GetOption<std::string>(configFileName, "", false);
|
||||
if (logfn.empty())
|
||||
return NULL;
|
||||
return nullptr;
|
||||
|
||||
if (configTimeStampFlag && sConfigMgr->GetOption<bool>(configTimeStampFlag, false, false))
|
||||
{
|
||||
|
|
@ -202,7 +202,7 @@ FILE* Log::openLogFile(char const* configFileName, char const* configTimeStampFl
|
|||
FILE* Log::openGmlogPerAccount(uint32 account)
|
||||
{
|
||||
if (m_gmlog_filename_format.empty())
|
||||
return NULL;
|
||||
return nullptr;
|
||||
|
||||
char namebuf[ACORE_PATH_MAX];
|
||||
snprintf(namebuf, ACORE_PATH_MAX, m_gmlog_filename_format.c_str(), account);
|
||||
|
|
@ -211,7 +211,7 @@ FILE* Log::openGmlogPerAccount(uint32 account)
|
|||
|
||||
void Log::outTimestamp(FILE* file)
|
||||
{
|
||||
time_t t = time(NULL);
|
||||
time_t t = time(nullptr);
|
||||
tm* aTm = localtime(&t);
|
||||
// YYYY year
|
||||
// MM month (2 digits 01-12)
|
||||
|
|
@ -337,7 +337,7 @@ void Log::ResetColor(bool stdout_stream)
|
|||
|
||||
std::string Log::GetTimestampStr()
|
||||
{
|
||||
time_t t = time(NULL);
|
||||
time_t t = time(nullptr);
|
||||
tm aTm;
|
||||
localtime_r(&t, &aTm);
|
||||
// YYYY year
|
||||
|
|
@ -918,7 +918,7 @@ void Log::outChar(const char* str, ...)
|
|||
|
||||
void Log::outCharDump(const char* str, uint32 account_id, uint32 guid, const char* name)
|
||||
{
|
||||
FILE* file = NULL;
|
||||
FILE* file = nullptr;
|
||||
if (m_charLog_Dump_Separate)
|
||||
{
|
||||
char fileName[29]; // Max length: name(12) + guid(11) + _.log (5) + \0
|
||||
|
|
|
|||
|
|
@ -89,7 +89,7 @@ public:
|
|||
//! Resets all underlying variables (param, result and stage)
|
||||
void Reset()
|
||||
{
|
||||
SetParam(NULL);
|
||||
SetParam(nullptr);
|
||||
FreeResult();
|
||||
ResetStage();
|
||||
}
|
||||
|
|
@ -180,7 +180,7 @@ public:
|
|||
void Reset()
|
||||
{
|
||||
SetFirstParam(0);
|
||||
SetSecondParam(NULL);
|
||||
SetSecondParam(nullptr);
|
||||
FreeResult();
|
||||
ResetStage();
|
||||
}
|
||||
|
|
@ -281,9 +281,9 @@ public:
|
|||
//! Resets all underlying variables (param, result and stage)
|
||||
void Reset()
|
||||
{
|
||||
SetFirstParam(NULL);
|
||||
SetSecondParam(NULL);
|
||||
SetThirdParam(NULL);
|
||||
SetFirstParam(nullptr);
|
||||
SetSecondParam(nullptr);
|
||||
SetThirdParam(nullptr);
|
||||
FreeResult();
|
||||
ResetStage();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -48,7 +48,7 @@ protected:
|
|||
{
|
||||
sLog->outError("Out of file descriptors, suspending incoming connections for 10 seconds");
|
||||
reactor()->remove_handler(this, ACE_Event_Handler::ACCEPT_MASK | ACE_Event_Handler::DONT_CALL);
|
||||
reactor()->schedule_timer(this, NULL, ACE_Time_Value(10));
|
||||
reactor()->schedule_timer(this, nullptr, ACE_Time_Value(10));
|
||||
}
|
||||
#endif
|
||||
return 0;
|
||||
|
|
|
|||
|
|
@ -443,7 +443,7 @@ void PetAI::OwnerAttacked(Unit* target)
|
|||
// Called when owner attacks something. Allows defensive pets to know
|
||||
// that they need to assist
|
||||
|
||||
// Target might be NULL if called from spell with invalid cast targets
|
||||
// Target might be nullptr if called from spell with invalid cast targets
|
||||
if (!target)
|
||||
return;
|
||||
|
||||
|
|
|
|||
|
|
@ -191,7 +191,7 @@ void UnitAI::DoCastAOE(uint32 spellId, bool triggered)
|
|||
if (!triggered && me->HasUnitState(UNIT_STATE_CASTING))
|
||||
return;
|
||||
|
||||
me->CastSpell((Unit*)NULL, spellId, triggered);
|
||||
me->CastSpell((Unit*)nullptr, spellId, triggered);
|
||||
}
|
||||
|
||||
#define UPDATE_TARGET(a) {if (AIInfo->target<a) AIInfo->target=a;}
|
||||
|
|
|
|||
|
|
@ -26,12 +26,12 @@ void CreatureAI::OnCharmed(bool /*apply*/)
|
|||
AISpellInfoType* UnitAI::AISpellInfo;
|
||||
AISpellInfoType* GetAISpellInfo(uint32 i) { return &CreatureAI::AISpellInfo[i]; }
|
||||
|
||||
void CreatureAI::Talk(uint8 id, WorldObject const* whisperTarget /*= NULL*/)
|
||||
void CreatureAI::Talk(uint8 id, WorldObject const* whisperTarget /*= nullptr*/)
|
||||
{
|
||||
sCreatureTextMgr->SendChat(me, id, whisperTarget);
|
||||
}
|
||||
|
||||
void CreatureAI::DoZoneInCombat(Creature* creature /*= NULL*/, float maxRangeToNearestTarget /* = 50.0f*/)
|
||||
void CreatureAI::DoZoneInCombat(Creature* creature /*= nullptr*/, float maxRangeToNearestTarget /* = 50.0f*/)
|
||||
{
|
||||
if (!creature)
|
||||
creature = me;
|
||||
|
|
|
|||
|
|
@ -125,7 +125,7 @@ public:
|
|||
// Called at reaching home after evade
|
||||
virtual void JustReachedHome() {}
|
||||
|
||||
void DoZoneInCombat(Creature* creature = NULL, float maxRangeToNearestTarget = 50.0f);
|
||||
void DoZoneInCombat(Creature* creature = nullptr, float maxRangeToNearestTarget = 50.0f);
|
||||
|
||||
// Called at text emote receive from player
|
||||
virtual void ReceiveEmote(Player* /*player*/, uint32 /*emoteId*/) {}
|
||||
|
|
|
|||
|
|
@ -86,7 +86,7 @@ namespace FactorySelector
|
|||
ainame = (ai_factory == nullptr) ? "NullCreatureAI" : ai_factory->key();
|
||||
sLog->outDebug(LOG_FILTER_TSCR, "Creature %u used AI is %s.", creature->GetGUIDLow(), ainame.c_str());
|
||||
#endif
|
||||
return (ai_factory == NULL ? new NullCreatureAI(creature) : ai_factory->Create(creature));
|
||||
return (ai_factory == nullptr ? new NullCreatureAI(creature) : ai_factory->Create(creature));
|
||||
}
|
||||
|
||||
MovementGenerator* selectMovementGenerator(Creature* creature)
|
||||
|
|
@ -114,7 +114,7 @@ namespace FactorySelector
|
|||
}
|
||||
}*/
|
||||
|
||||
return (mv_factory == NULL ? NULL : mv_factory->Create(creature));
|
||||
return (mv_factory == nullptr ? nullptr : mv_factory->Create(creature));
|
||||
}
|
||||
|
||||
GameObjectAI* SelectGameObjectAI(GameObject* go)
|
||||
|
|
@ -130,10 +130,10 @@ namespace FactorySelector
|
|||
//future goAI types go here
|
||||
|
||||
#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS)
|
||||
std::string ainame = (ai_factory == NULL || go->GetScriptId()) ? "NullGameObjectAI" : ai_factory->key();
|
||||
std::string ainame = (ai_factory == nullptr || go->GetScriptId()) ? "NullGameObjectAI" : ai_factory->key();
|
||||
sLog->outDebug(LOG_FILTER_TSCR, "GameObject %u used AI is %s.", go->GetGUIDLow(), ainame.c_str());
|
||||
#endif
|
||||
|
||||
return (ai_factory == NULL ? new NullGameObjectAI(go) : ai_factory->Create(go));
|
||||
return (ai_factory == nullptr ? new NullGameObjectAI(go) : ai_factory->Create(go));
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -407,7 +407,7 @@ void npc_escortAI::SetRun(bool on)
|
|||
}
|
||||
|
||||
//TODO: get rid of this many variables passed in function.
|
||||
void npc_escortAI::Start(bool isActiveAttacker /* = true*/, bool run /* = false */, uint64 playerGUID /* = 0 */, Quest const* quest /* = NULL */, bool instantRespawn /* = false */, bool canLoopPath /* = false */, bool resetWaypoints /* = true */)
|
||||
void npc_escortAI::Start(bool isActiveAttacker /* = true*/, bool run /* = false */, uint64 playerGUID /* = 0 */, Quest const* quest /* = nullptr */, bool instantRespawn /* = false */, bool canLoopPath /* = false */, bool resetWaypoints /* = true */)
|
||||
{
|
||||
if (me->GetVictim())
|
||||
{
|
||||
|
|
|
|||
|
|
@ -78,7 +78,7 @@ public:
|
|||
virtual void WaypointReached(uint32 pointId) = 0;
|
||||
virtual void WaypointStart(uint32 /*pointId*/) {}
|
||||
|
||||
void Start(bool isActiveAttacker = true, bool run = false, uint64 playerGUID = 0, Quest const* quest = NULL, bool instantRespawn = false, bool canLoopPath = false, bool resetWaypoints = true);
|
||||
void Start(bool isActiveAttacker = true, bool run = false, uint64 playerGUID = 0, Quest const* quest = nullptr, bool instantRespawn = false, bool canLoopPath = false, bool resetWaypoints = true);
|
||||
|
||||
void SetRun(bool on = true);
|
||||
void SetEscortPaused(bool on);
|
||||
|
|
|
|||
|
|
@ -205,7 +205,7 @@ void SmartAI::StartPath(bool run, uint32 path, bool repeat, Unit* invoker)
|
|||
GenerateWayPointArray(&pathPoints);
|
||||
|
||||
me->GetMotionMaster()->MoveSplinePath(&pathPoints);
|
||||
GetScript()->ProcessEventsFor(SMART_EVENT_WAYPOINT_START, NULL, wp->id, GetScript()->GetPathId());
|
||||
GetScript()->ProcessEventsFor(SMART_EVENT_WAYPOINT_START, nullptr, wp->id, GetScript()->GetPathId());
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -248,7 +248,7 @@ void SmartAI::PausePath(uint32 delay, bool forced)
|
|||
me->StopMoving();
|
||||
me->GetMotionMaster()->MoveIdle();//force stop
|
||||
}
|
||||
GetScript()->ProcessEventsFor(SMART_EVENT_WAYPOINT_PAUSED, NULL, mCurrentWPID, GetScript()->GetPathId());
|
||||
GetScript()->ProcessEventsFor(SMART_EVENT_WAYPOINT_PAUSED, nullptr, mCurrentWPID, GetScript()->GetPathId());
|
||||
}
|
||||
|
||||
void SmartAI::StopPath(uint32 DespawnTime, uint32 quest, bool fail)
|
||||
|
|
@ -266,7 +266,7 @@ void SmartAI::StopPath(uint32 DespawnTime, uint32 quest, bool fail)
|
|||
|
||||
me->StopMoving();
|
||||
me->GetMotionMaster()->MoveIdle();
|
||||
GetScript()->ProcessEventsFor(SMART_EVENT_WAYPOINT_STOPPED, NULL, mCurrentWPID, GetScript()->GetPathId());
|
||||
GetScript()->ProcessEventsFor(SMART_EVENT_WAYPOINT_STOPPED, nullptr, mCurrentWPID, GetScript()->GetPathId());
|
||||
EndPath(fail);
|
||||
}
|
||||
|
||||
|
|
@ -335,7 +335,7 @@ void SmartAI::EndPath(bool fail)
|
|||
return;
|
||||
}
|
||||
|
||||
GetScript()->ProcessEventsFor(SMART_EVENT_WAYPOINT_ENDED, NULL, mCurrentWPID, GetScript()->GetPathId());
|
||||
GetScript()->ProcessEventsFor(SMART_EVENT_WAYPOINT_ENDED, nullptr, mCurrentWPID, GetScript()->GetPathId());
|
||||
mCurrentWPID = 0;
|
||||
|
||||
if (mCanRepeatPath)
|
||||
|
|
@ -398,7 +398,7 @@ void SmartAI::UpdatePath(const uint32 diff)
|
|||
{
|
||||
if (!me->IsInCombat() && !HasEscortState(SMART_ESCORT_RETURNING) && (mWPReached || mForcedPaused))
|
||||
{
|
||||
GetScript()->ProcessEventsFor(SMART_EVENT_WAYPOINT_RESUMED, NULL, mCurrentWPID, GetScript()->GetPathId());
|
||||
GetScript()->ProcessEventsFor(SMART_EVENT_WAYPOINT_RESUMED, nullptr, mCurrentWPID, GetScript()->GetPathId());
|
||||
RemoveEscortState(SMART_ESCORT_PAUSED);
|
||||
if (mForcedPaused)// if paused between 2 wps resend movement
|
||||
{
|
||||
|
|
@ -565,7 +565,7 @@ void SmartAI::MovepointReached(uint32 id)
|
|||
}
|
||||
|
||||
mWPReached = true;
|
||||
GetScript()->ProcessEventsFor(SMART_EVENT_WAYPOINT_REACHED, NULL, mCurrentWPID);
|
||||
GetScript()->ProcessEventsFor(SMART_EVENT_WAYPOINT_REACHED, nullptr, mCurrentWPID);
|
||||
|
||||
if (mLastWP)
|
||||
{
|
||||
|
|
@ -602,7 +602,7 @@ void SmartAI::MovementInform(uint32 MovementType, uint32 Data)
|
|||
if (MovementType == POINT_MOTION_TYPE && Data == SMART_ESCORT_LAST_OOC_POINT)
|
||||
me->ClearUnitState(UNIT_STATE_EVADE);
|
||||
|
||||
GetScript()->ProcessEventsFor(SMART_EVENT_MOVEMENTINFORM, NULL, MovementType, Data);
|
||||
GetScript()->ProcessEventsFor(SMART_EVENT_MOVEMENTINFORM, nullptr, MovementType, Data);
|
||||
if (!HasEscortState(SMART_ESCORT_ESCORTING))
|
||||
return;
|
||||
|
||||
|
|
@ -857,7 +857,7 @@ void SmartAI::UpdateAIWhileCharmed(const uint32 /*diff*/)
|
|||
|
||||
void SmartAI::CorpseRemoved(uint32& respawnDelay)
|
||||
{
|
||||
GetScript()->ProcessEventsFor(SMART_EVENT_CORPSE_REMOVED, NULL, respawnDelay);
|
||||
GetScript()->ProcessEventsFor(SMART_EVENT_CORPSE_REMOVED, nullptr, respawnDelay);
|
||||
|
||||
// xinef: end escort upon corpse remove, safe check in case of immediate despawn
|
||||
if (IsEscorted())
|
||||
|
|
@ -882,12 +882,12 @@ void SmartAI::InitializeAI()
|
|||
|
||||
void SmartAI::OnCharmed(bool apply)
|
||||
{
|
||||
GetScript()->ProcessEventsFor(SMART_EVENT_CHARMED, NULL, 0, 0, apply);
|
||||
GetScript()->ProcessEventsFor(SMART_EVENT_CHARMED, nullptr, 0, 0, apply);
|
||||
}
|
||||
|
||||
void SmartAI::DoAction(int32 param)
|
||||
{
|
||||
GetScript()->ProcessEventsFor(SMART_EVENT_ACTION_DONE, NULL, param);
|
||||
GetScript()->ProcessEventsFor(SMART_EVENT_ACTION_DONE, nullptr, param);
|
||||
}
|
||||
|
||||
uint32 SmartAI::GetData(uint32 /*id*/) const
|
||||
|
|
@ -897,7 +897,7 @@ uint32 SmartAI::GetData(uint32 /*id*/) const
|
|||
|
||||
void SmartAI::SetData(uint32 id, uint32 value)
|
||||
{
|
||||
GetScript()->ProcessEventsFor(SMART_EVENT_DATA_SET, NULL, id, value);
|
||||
GetScript()->ProcessEventsFor(SMART_EVENT_DATA_SET, nullptr, id, value);
|
||||
}
|
||||
|
||||
void SmartAI::SetGUID(uint64 /*guid*/, int32 /*id*/)
|
||||
|
|
@ -1052,7 +1052,7 @@ void SmartAI::SetScript9(SmartScriptHolder& e, uint32 entry, Unit* invoker)
|
|||
|
||||
void SmartAI::sOnGameEvent(bool start, uint16 eventId)
|
||||
{
|
||||
GetScript()->ProcessEventsFor(start ? SMART_EVENT_GAME_EVENT_START : SMART_EVENT_GAME_EVENT_END, NULL, eventId);
|
||||
GetScript()->ProcessEventsFor(start ? SMART_EVENT_GAME_EVENT_START : SMART_EVENT_GAME_EVENT_END, nullptr, eventId);
|
||||
}
|
||||
|
||||
void SmartAI::OnSpellClick(Unit* clicker, bool& /*result*/)
|
||||
|
|
@ -1100,14 +1100,14 @@ bool SmartGameObjectAI::GossipHello(Player* player, bool reportUse)
|
|||
#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS)
|
||||
sLog->outDebug(LOG_FILTER_DATABASE_AI, "SmartGameObjectAI::GossipHello");
|
||||
#endif
|
||||
GetScript()->ProcessEventsFor(SMART_EVENT_GOSSIP_HELLO, player, (uint32)reportUse, 0, false, NULL, go);
|
||||
GetScript()->ProcessEventsFor(SMART_EVENT_GOSSIP_HELLO, player, (uint32)reportUse, 0, false, nullptr, go);
|
||||
return false;
|
||||
}
|
||||
|
||||
// Called when a player selects a gossip item in the gameobject's gossip menu.
|
||||
bool SmartGameObjectAI::GossipSelect(Player* player, uint32 sender, uint32 action)
|
||||
{
|
||||
GetScript()->ProcessEventsFor(SMART_EVENT_GOSSIP_SELECT, player, sender, action, false, NULL, go);
|
||||
GetScript()->ProcessEventsFor(SMART_EVENT_GOSSIP_SELECT, player, sender, action, false, nullptr, go);
|
||||
return false;
|
||||
}
|
||||
|
||||
|
|
@ -1120,26 +1120,26 @@ bool SmartGameObjectAI::GossipSelectCode(Player* /*player*/, uint32 /*sender*/,
|
|||
// Called when a player accepts a quest from the gameobject.
|
||||
bool SmartGameObjectAI::QuestAccept(Player* player, Quest const* quest)
|
||||
{
|
||||
GetScript()->ProcessEventsFor(SMART_EVENT_ACCEPTED_QUEST, player, quest->GetQuestId(), 0, false, NULL, go);
|
||||
GetScript()->ProcessEventsFor(SMART_EVENT_ACCEPTED_QUEST, player, quest->GetQuestId(), 0, false, nullptr, go);
|
||||
return false;
|
||||
}
|
||||
|
||||
// Called when a player selects a quest reward.
|
||||
bool SmartGameObjectAI::QuestReward(Player* player, Quest const* quest, uint32 opt)
|
||||
{
|
||||
GetScript()->ProcessEventsFor(SMART_EVENT_REWARD_QUEST, player, quest->GetQuestId(), opt, false, NULL, go);
|
||||
GetScript()->ProcessEventsFor(SMART_EVENT_REWARD_QUEST, player, quest->GetQuestId(), opt, false, nullptr, go);
|
||||
return false;
|
||||
}
|
||||
|
||||
// Called when the gameobject is destroyed (destructible buildings only).
|
||||
void SmartGameObjectAI::Destroyed(Player* player, uint32 eventId)
|
||||
{
|
||||
GetScript()->ProcessEventsFor(SMART_EVENT_DEATH, player, eventId, 0, false, NULL, go);
|
||||
GetScript()->ProcessEventsFor(SMART_EVENT_DEATH, player, eventId, 0, false, nullptr, go);
|
||||
}
|
||||
|
||||
void SmartGameObjectAI::SetData(uint32 id, uint32 value)
|
||||
{
|
||||
GetScript()->ProcessEventsFor(SMART_EVENT_DATA_SET, NULL, id, value);
|
||||
GetScript()->ProcessEventsFor(SMART_EVENT_DATA_SET, nullptr, id, value);
|
||||
}
|
||||
|
||||
void SmartGameObjectAI::SetScript9(SmartScriptHolder& e, uint32 entry, Unit* invoker)
|
||||
|
|
@ -1151,7 +1151,7 @@ void SmartGameObjectAI::SetScript9(SmartScriptHolder& e, uint32 entry, Unit* inv
|
|||
|
||||
void SmartGameObjectAI::OnGameEvent(bool start, uint16 eventId)
|
||||
{
|
||||
GetScript()->ProcessEventsFor(start ? SMART_EVENT_GAME_EVENT_START : SMART_EVENT_GAME_EVENT_END, NULL, eventId);
|
||||
GetScript()->ProcessEventsFor(start ? SMART_EVENT_GAME_EVENT_START : SMART_EVENT_GAME_EVENT_END, nullptr, eventId);
|
||||
}
|
||||
|
||||
void SmartGameObjectAI::OnStateChanged(uint32 state, Unit* unit)
|
||||
|
|
@ -1161,7 +1161,7 @@ void SmartGameObjectAI::OnStateChanged(uint32 state, Unit* unit)
|
|||
|
||||
void SmartGameObjectAI::EventInform(uint32 eventId)
|
||||
{
|
||||
GetScript()->ProcessEventsFor(SMART_EVENT_GO_EVENT_INFORM, NULL, eventId);
|
||||
GetScript()->ProcessEventsFor(SMART_EVENT_GO_EVENT_INFORM, nullptr, eventId);
|
||||
}
|
||||
|
||||
void SmartGameObjectAI::SpellHit(Unit* unit, const SpellInfo* spellInfo)
|
||||
|
|
|
|||
|
|
@ -749,7 +749,7 @@ void SmartScript::ProcessAction(SmartScriptHolder& e, Unit* unit, uint32 var0, u
|
|||
{
|
||||
if (go)
|
||||
{
|
||||
// Xinef: may be NULL!
|
||||
// Xinef: may be nullptr!
|
||||
go->CastSpell((*itr)->ToUnit(), e.action.cast.spell);
|
||||
}
|
||||
|
||||
|
|
@ -2104,7 +2104,7 @@ void SmartScript::ProcessAction(SmartScriptHolder& e, Unit* unit, uint32 var0, u
|
|||
break;
|
||||
}
|
||||
case SMART_ACTION_TRIGGER_TIMED_EVENT:
|
||||
ProcessEventsFor((SMART_EVENT)SMART_EVENT_TIMED_EVENT_TRIGGERED, NULL, e.action.timeEvent.id);
|
||||
ProcessEventsFor((SMART_EVENT)SMART_EVENT_TIMED_EVENT_TRIGGERED, nullptr, e.action.timeEvent.id);
|
||||
|
||||
// xinef: remove this event if not repeatable
|
||||
if (e.event.event_flags & SMART_EVENT_FLAG_NOT_REPEATABLE)
|
||||
|
|
@ -2987,7 +2987,7 @@ void SmartScript::ProcessAction(SmartScriptHolder& e, Unit* unit, uint32 var0, u
|
|||
case SMART_ACTION_TRIGGER_RANDOM_TIMED_EVENT:
|
||||
{
|
||||
uint32 eventId = urand(e.action.randomTimedEvent.minId, e.action.randomTimedEvent.maxId);
|
||||
ProcessEventsFor((SMART_EVENT)SMART_EVENT_TIMED_EVENT_TRIGGERED, NULL, eventId);
|
||||
ProcessEventsFor((SMART_EVENT)SMART_EVENT_TIMED_EVENT_TRIGGERED, nullptr, eventId);
|
||||
break;
|
||||
}
|
||||
case SMART_ACTION_SET_HOVER:
|
||||
|
|
@ -3427,7 +3427,7 @@ SmartScriptHolder SmartScript::CreateSmartEvent(SMART_EVENT e, uint32 event_flag
|
|||
return script;
|
||||
}
|
||||
|
||||
ObjectList* SmartScript::GetTargets(SmartScriptHolder const& e, Unit* invoker /*= NULL*/)
|
||||
ObjectList* SmartScript::GetTargets(SmartScriptHolder const& e, Unit* invoker /*= nullptr*/)
|
||||
{
|
||||
Unit* scriptTrigger = nullptr;
|
||||
if (invoker)
|
||||
|
|
@ -4297,7 +4297,7 @@ void SmartScript::ProcessEvent(SmartScriptHolder& e, Unit* unit, uint32 var0, ui
|
|||
{
|
||||
if (e.event.gameEvent.gameEventId != var0)
|
||||
return;
|
||||
ProcessAction(e, NULL, var0);
|
||||
ProcessAction(e, nullptr, var0);
|
||||
break;
|
||||
}
|
||||
case SMART_EVENT_GO_STATE_CHANGED:
|
||||
|
|
@ -4311,7 +4311,7 @@ void SmartScript::ProcessEvent(SmartScriptHolder& e, Unit* unit, uint32 var0, ui
|
|||
{
|
||||
if (e.event.eventInform.eventId != var0)
|
||||
return;
|
||||
ProcessAction(e, NULL, var0);
|
||||
ProcessAction(e, nullptr, var0);
|
||||
break;
|
||||
}
|
||||
case SMART_EVENT_ACTION_DONE:
|
||||
|
|
@ -4518,7 +4518,7 @@ void SmartScript::UpdateTimer(SmartScriptHolder& e, uint32 const diff)
|
|||
if (e.GetEventType() == SMART_EVENT_UPDATE_IC && (!me || !me->IsInCombat()))
|
||||
return;
|
||||
|
||||
if (e.GetEventType() == SMART_EVENT_UPDATE_OOC && (me && me->IsInCombat()))//can be used with me=NULL (go script)
|
||||
if (e.GetEventType() == SMART_EVENT_UPDATE_OOC && (me && me->IsInCombat()))//can be used with me=nullptr (go script)
|
||||
return;
|
||||
|
||||
if (e.timer < diff)
|
||||
|
|
@ -4654,7 +4654,7 @@ void SmartScript::OnUpdate(uint32 const diff)
|
|||
mTalkerEntry = 0;
|
||||
mTextTimer = 0;
|
||||
mUseTextTimer = false;
|
||||
ProcessEventsFor(SMART_EVENT_TEXT_OVER, NULL, textID, entry);
|
||||
ProcessEventsFor(SMART_EVENT_TEXT_OVER, nullptr, textID, entry);
|
||||
}
|
||||
else mTextTimer -= diff;
|
||||
}
|
||||
|
|
@ -4717,7 +4717,7 @@ void SmartScript::GetScript()
|
|||
else if (trigger)
|
||||
{
|
||||
e = sSmartScriptMgr->GetScript((int32)trigger->entry, mScriptType);
|
||||
FillScript(e, NULL, trigger);
|
||||
FillScript(e, nullptr, trigger);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -4756,7 +4756,7 @@ void SmartScript::OnInitialize(WorldObject* obj, AreaTrigger const* at)
|
|||
}
|
||||
else
|
||||
{
|
||||
sLog->outError("SmartScript::OnInitialize: !WARNING! Initialized objects are NULL.");
|
||||
sLog->outError("SmartScript::OnInitialize: !WARNING! Initialized objects are nullptr.");
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -25,14 +25,14 @@ public:
|
|||
void GetScript();
|
||||
void FillScript(SmartAIEventList e, WorldObject* obj, AreaTrigger const* at);
|
||||
|
||||
void ProcessEventsFor(SMART_EVENT e, Unit* unit = NULL, uint32 var0 = 0, uint32 var1 = 0, bool bvar = false, const SpellInfo* spell = NULL, GameObject* gob = nullptr);
|
||||
void ProcessEvent(SmartScriptHolder& e, Unit* unit = NULL, uint32 var0 = 0, uint32 var1 = 0, bool bvar = false, const SpellInfo* spell = NULL, GameObject* gob = nullptr);
|
||||
void ProcessEventsFor(SMART_EVENT e, Unit* unit = nullptr, uint32 var0 = 0, uint32 var1 = 0, bool bvar = false, const SpellInfo* spell = nullptr, GameObject* gob = nullptr);
|
||||
void ProcessEvent(SmartScriptHolder& e, Unit* unit = nullptr, uint32 var0 = 0, uint32 var1 = 0, bool bvar = false, const SpellInfo* spell = nullptr, GameObject* gob = nullptr);
|
||||
bool CheckTimer(SmartScriptHolder const& e) const;
|
||||
void RecalcTimer(SmartScriptHolder& e, uint32 min, uint32 max);
|
||||
void UpdateTimer(SmartScriptHolder& e, uint32 const diff);
|
||||
void InitTimer(SmartScriptHolder& e);
|
||||
void ProcessAction(SmartScriptHolder& e, Unit* unit = NULL, uint32 var0 = 0, uint32 var1 = 0, bool bvar = false, const SpellInfo* spell = NULL, GameObject* gob = nullptr);
|
||||
void ProcessTimedAction(SmartScriptHolder& e, uint32 const& min, uint32 const& max, Unit* unit = NULL, uint32 var0 = 0, uint32 var1 = 0, bool bvar = false, const SpellInfo* spell = NULL, GameObject* gob = nullptr);
|
||||
void ProcessAction(SmartScriptHolder& e, Unit* unit = nullptr, uint32 var0 = 0, uint32 var1 = 0, bool bvar = false, const SpellInfo* spell = nullptr, GameObject* gob = nullptr);
|
||||
void ProcessTimedAction(SmartScriptHolder& e, uint32 const& min, uint32 const& max, Unit* unit = nullptr, uint32 var0 = 0, uint32 var1 = 0, bool bvar = false, const SpellInfo* spell = nullptr, GameObject* gob = nullptr);
|
||||
ObjectList* GetTargets(SmartScriptHolder const& e, Unit* invoker = nullptr);
|
||||
ObjectList* GetWorldObjectsInDist(float dist);
|
||||
void InstallTemplate(SmartScriptHolder const& e);
|
||||
|
|
@ -145,7 +145,7 @@ public:
|
|||
else
|
||||
mCounterList.insert(std::make_pair(id, value));
|
||||
|
||||
ProcessEventsFor(SMART_EVENT_COUNTER_SET, NULL, id);
|
||||
ProcessEventsFor(SMART_EVENT_COUNTER_SET, nullptr, id);
|
||||
}
|
||||
|
||||
uint32 GetCounterValue(uint32 id)
|
||||
|
|
|
|||
|
|
@ -1849,7 +1849,7 @@ private:
|
|||
{
|
||||
if (!data)
|
||||
{
|
||||
sLog->outErrorDb("SmartAIMgr: Entry %d SourceType %u Event %u Action %u Parameter can not be NULL, skipped.", e.entryOrGuid, e.GetScriptType(), e.event_id, e.GetActionType());
|
||||
sLog->outErrorDb("SmartAIMgr: Entry %d SourceType %u Event %u Action %u Parameter can not be nullptr, skipped.", e.entryOrGuid, e.GetScriptType(), e.event_id, e.GetActionType());
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
|
|
|
|||
|
|
@ -755,7 +755,7 @@ static const uint32 achievIdForDungeon[][4] =
|
|||
/**
|
||||
* this function will be called whenever the user might have done a criteria relevant action
|
||||
*/
|
||||
void AchievementMgr::UpdateAchievementCriteria(AchievementCriteriaTypes type, uint32 miscValue1 /*= 0*/, uint32 miscValue2 /*= 0*/, Unit* unit /*= NULL*/)
|
||||
void AchievementMgr::UpdateAchievementCriteria(AchievementCriteriaTypes type, uint32 miscValue1 /*= 0*/, uint32 miscValue2 /*= 0*/, Unit* unit /*= nullptr*/)
|
||||
{
|
||||
// disable for gamemasters with GM-mode enabled
|
||||
if (m_player->IsGameMaster())
|
||||
|
|
|
|||
|
|
@ -477,7 +477,7 @@ void AuctionHouseObject::Update()
|
|||
time_t checkTime = sWorld->GetGameTime() + 60;
|
||||
///- Handle expired auctions
|
||||
|
||||
// If storage is empty, no need to update. next == NULL in this case.
|
||||
// If storage is empty, no need to update. next == nullptr in this case.
|
||||
if (AuctionsMap.empty())
|
||||
return;
|
||||
|
||||
|
|
|
|||
|
|
@ -463,7 +463,7 @@ void Battlefield::SendWarningToAllInZone(uint32 entry)
|
|||
{
|
||||
if (Unit* unit = ObjectAccessor::FindUnit(StalkerGuid))
|
||||
if (Creature* stalker = unit->ToCreature())
|
||||
sCreatureTextMgr->SendChat(stalker, (uint8)entry, NULL, CHAT_MSG_ADDON, LANG_ADDON, TEXT_RANGE_ZONE);
|
||||
sCreatureTextMgr->SendChat(stalker, (uint8)entry, nullptr, CHAT_MSG_ADDON, LANG_ADDON, TEXT_RANGE_ZONE);
|
||||
}
|
||||
|
||||
void Battlefield::SendWarningToPlayer(Player* player, uint32 entry)
|
||||
|
|
|
|||
|
|
@ -98,7 +98,7 @@ public:
|
|||
virtual void SendChangePhase();
|
||||
|
||||
bool SetCapturePointData(GameObject* capturePoint);
|
||||
GameObject* GetCapturePointGo() { return ObjectAccessor::GetObjectInWorld(m_capturePoint, (GameObject*)NULL); }
|
||||
GameObject* GetCapturePointGo() { return ObjectAccessor::GetObjectInWorld(m_capturePoint, (GameObject*)nullptr); }
|
||||
GameObject* GetCapturePointGo(WorldObject* obj) { return ObjectAccessor::GetGameObject(*obj, m_capturePoint); }
|
||||
|
||||
TeamId GetTeamId() { return m_team; }
|
||||
|
|
|
|||
|
|
@ -373,7 +373,7 @@ public:
|
|||
bool SetupBattlefield() override;
|
||||
|
||||
/// Return pointer to relic object
|
||||
GameObject* GetRelic() { return ObjectAccessor::GetObjectInWorld(m_titansRelic, (GameObject*)NULL); }
|
||||
GameObject* GetRelic() { return ObjectAccessor::GetObjectInWorld(m_titansRelic, (GameObject*)nullptr); }
|
||||
|
||||
/// Define relic object
|
||||
//void SetRelic(GameObject* relic) { m_titansRelic = relic; }
|
||||
|
|
@ -1136,11 +1136,11 @@ struct BfWGGameObjectBuilding
|
|||
break;
|
||||
}
|
||||
|
||||
GameObject* go = ObjectAccessor::GetObjectInWorld(m_Build, (GameObject*)NULL);
|
||||
GameObject* go = ObjectAccessor::GetObjectInWorld(m_Build, (GameObject*)nullptr);
|
||||
if (go)
|
||||
{
|
||||
// Rebuild gameobject
|
||||
go->SetDestructibleState(GO_DESTRUCTIBLE_REBUILDING, NULL, true);
|
||||
go->SetDestructibleState(GO_DESTRUCTIBLE_REBUILDING, nullptr, true);
|
||||
go->SetUInt32Value(GAMEOBJECT_FACTION, WintergraspFaction[m_Team]);
|
||||
}
|
||||
|
||||
|
|
@ -1190,7 +1190,7 @@ struct BfWGGameObjectBuilding
|
|||
{
|
||||
// Inform the global wintergrasp script of the destruction of this object
|
||||
case BATTLEFIELD_WG_OBJECTTYPE_TOWER:
|
||||
m_WG->UpdatedDestroyedTowerCount(TeamId(m_Team), ObjectAccessor::GetObjectInWorld(m_Build, (GameObject*)NULL));
|
||||
m_WG->UpdatedDestroyedTowerCount(TeamId(m_Team), ObjectAccessor::GetObjectInWorld(m_Build, (GameObject*)nullptr));
|
||||
break;
|
||||
case BATTLEFIELD_WG_OBJECTTYPE_DOOR_LAST:
|
||||
m_WG->SetRelicInteractible(true);
|
||||
|
|
@ -1202,7 +1202,7 @@ struct BfWGGameObjectBuilding
|
|||
case BATTLEFIELD_WG_OBJECTTYPE_DOOR:
|
||||
case BATTLEFIELD_WG_OBJECTTYPE_WALL:
|
||||
case BATTLEFIELD_WG_OBJECTTYPE_KEEP_TOWER:
|
||||
m_WG->UpdatedDestroyedTowerCount(TeamId(m_Team), ObjectAccessor::GetObjectInWorld(m_Build, (GameObject*)NULL));
|
||||
m_WG->UpdatedDestroyedTowerCount(TeamId(m_Team), ObjectAccessor::GetObjectInWorld(m_Build, (GameObject*)nullptr));
|
||||
break;
|
||||
}
|
||||
|
||||
|
|
@ -1247,7 +1247,7 @@ struct BfWGGameObjectBuilding
|
|||
{
|
||||
case BATTLEFIELD_WG_OBJECTSTATE_ALLIANCE_INTACT:
|
||||
case BATTLEFIELD_WG_OBJECTSTATE_HORDE_INTACT:
|
||||
gobj->SetDestructibleState(GO_DESTRUCTIBLE_REBUILDING, NULL, true);
|
||||
gobj->SetDestructibleState(GO_DESTRUCTIBLE_REBUILDING, nullptr, true);
|
||||
break;
|
||||
case BATTLEFIELD_WG_OBJECTSTATE_ALLIANCE_DESTROY:
|
||||
case BATTLEFIELD_WG_OBJECTSTATE_HORDE_DESTROY:
|
||||
|
|
@ -1379,7 +1379,7 @@ struct BfWGGameObjectBuilding
|
|||
|
||||
void UpdateTurretAttack(bool disable)
|
||||
{
|
||||
GameObject* build = ObjectAccessor::GetObjectInWorld(m_Build, (GameObject*)NULL);
|
||||
GameObject* build = ObjectAccessor::GetObjectInWorld(m_Build, (GameObject*)nullptr);
|
||||
if (!build)
|
||||
return;
|
||||
|
||||
|
|
|
|||
|
|
@ -410,13 +410,13 @@ inline void Battleground::_ProcessProgress(uint32 diff)
|
|||
if (newtime > (MINUTE * IN_MILLISECONDS))
|
||||
{
|
||||
if (newtime / (MINUTE * IN_MILLISECONDS) != m_PrematureCountDownTimer / (MINUTE * IN_MILLISECONDS))
|
||||
PSendMessageToAll(LANG_BATTLEGROUND_PREMATURE_FINISH_WARNING, CHAT_MSG_SYSTEM, NULL, (uint32)(m_PrematureCountDownTimer / (MINUTE * IN_MILLISECONDS)));
|
||||
PSendMessageToAll(LANG_BATTLEGROUND_PREMATURE_FINISH_WARNING, CHAT_MSG_SYSTEM, nullptr, (uint32)(m_PrematureCountDownTimer / (MINUTE * IN_MILLISECONDS)));
|
||||
}
|
||||
else
|
||||
{
|
||||
//announce every 15 seconds
|
||||
if (newtime / (15 * IN_MILLISECONDS) != m_PrematureCountDownTimer / (15 * IN_MILLISECONDS))
|
||||
PSendMessageToAll(LANG_BATTLEGROUND_PREMATURE_FINISH_WARNING_SECS, CHAT_MSG_SYSTEM, NULL, (uint32)(m_PrematureCountDownTimer / IN_MILLISECONDS));
|
||||
PSendMessageToAll(LANG_BATTLEGROUND_PREMATURE_FINISH_WARNING_SECS, CHAT_MSG_SYSTEM, nullptr, (uint32)(m_PrematureCountDownTimer / IN_MILLISECONDS));
|
||||
}
|
||||
m_PrematureCountDownTimer = newtime;
|
||||
}
|
||||
|
|
@ -557,7 +557,7 @@ inline void Battleground::_ProcessJoin(uint32 diff)
|
|||
if (GetStatus() == STATUS_IN_PROGRESS)
|
||||
{
|
||||
for (ToBeTeleportedMap::const_iterator itr = m_ToBeTeleported.begin(); itr != m_ToBeTeleported.end(); ++itr)
|
||||
if (Player* p = ObjectAccessor::GetObjectInOrOutOfWorld(itr->first, (Player*)NULL))
|
||||
if (Player* p = ObjectAccessor::GetObjectInOrOutOfWorld(itr->first, (Player*)nullptr))
|
||||
if (Player* t = ObjectAccessor::FindPlayer(itr->second))
|
||||
{
|
||||
if (!t->FindMap() || t->FindMap() != GetBgMap())
|
||||
|
|
|
|||
|
|
@ -1050,7 +1050,7 @@ bool BGQueueRemoveEvent::Execute(uint64 /*e_time*/, uint32 /*p_time*/)
|
|||
|
||||
Battleground* bg = sBattlegroundMgr->GetBattleground(m_BgInstanceGUID);
|
||||
|
||||
// battleground can be already deleted, bg may be NULL!
|
||||
// battleground can be already deleted, bg may be nullptr!
|
||||
|
||||
// check if still in queue for this battleground
|
||||
uint32 queueSlot = player->GetBattlegroundQueueIndex(m_BgQueueTypeId);
|
||||
|
|
|
|||
|
|
@ -825,7 +825,7 @@ void BattlegroundAV::DePopulateNode(BG_AV_Nodes node)
|
|||
|
||||
//remove bonus honor aura trigger creature when node is lost
|
||||
if (node < BG_AV_NODES_MAX)//fail safe
|
||||
DelCreature(node + 302);//NULL checks are in DelCreature! 0-302 spirit guides
|
||||
DelCreature(node + 302);//nullptr checks are in DelCreature! 0-302 spirit guides
|
||||
}
|
||||
|
||||
BG_AV_Nodes BattlegroundAV::GetNodeThroughObject(uint32 object)
|
||||
|
|
|
|||
|
|
@ -372,7 +372,7 @@ void BattlegroundEY::RespawnFlagAfterDrop()
|
|||
|
||||
_flagState = BG_EY_FLAG_STATE_ON_BASE;
|
||||
RespawnFlag();
|
||||
if (GameObject* flag = ObjectAccessor::GetObjectInMap(GetDroppedFlagGUID(), FindBgMap(), (GameObject*)NULL))
|
||||
if (GameObject* flag = ObjectAccessor::GetObjectInMap(GetDroppedFlagGUID(), FindBgMap(), (GameObject*)nullptr))
|
||||
flag->Delete();
|
||||
SetDroppedFlagGUID(0);
|
||||
}
|
||||
|
|
@ -418,7 +418,7 @@ void BattlegroundEY::EventPlayerClickedOnFlag(Player* player, GameObject* gameOb
|
|||
player->CastSpell(player, BG_EY_NETHERSTORM_FLAG_SPELL, true);
|
||||
player->RemoveAurasWithInterruptFlags(AURA_INTERRUPT_FLAG_ENTER_PVP_COMBAT);
|
||||
|
||||
PSendMessageToAll(LANG_BG_EY_HAS_TAKEN_FLAG, player->GetTeamId() == TEAM_ALLIANCE ? CHAT_MSG_BG_SYSTEM_ALLIANCE : CHAT_MSG_BG_SYSTEM_HORDE, NULL, player->GetName().c_str());
|
||||
PSendMessageToAll(LANG_BG_EY_HAS_TAKEN_FLAG, player->GetTeamId() == TEAM_ALLIANCE ? CHAT_MSG_BG_SYSTEM_ALLIANCE : CHAT_MSG_BG_SYSTEM_HORDE, nullptr, player->GetName().c_str());
|
||||
PlaySoundToAll(player->GetTeamId() == TEAM_ALLIANCE ? BG_EY_SOUND_FLAG_PICKED_UP_ALLIANCE : BG_EY_SOUND_FLAG_PICKED_UP_HORDE);
|
||||
UpdateWorldState(NETHERSTORM_FLAG, 0);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -234,7 +234,7 @@ void BattlegroundIC::PostUpdateImpl(uint32 diff)
|
|||
UpdateNodeWorldState(&nodePoint[i]);
|
||||
HandleCapturedNodes(&nodePoint[i], false);
|
||||
|
||||
SendMessage2ToAll(LANG_BG_IC_TEAM_HAS_TAKEN_NODE, CHAT_MSG_BG_SYSTEM_NEUTRAL, NULL, (nodePoint[i].faction == TEAM_ALLIANCE ? LANG_BG_IC_ALLIANCE : LANG_BG_IC_HORDE), nodePoint[i].string);
|
||||
SendMessage2ToAll(LANG_BG_IC_TEAM_HAS_TAKEN_NODE, CHAT_MSG_BG_SYSTEM_NEUTRAL, nullptr, (nodePoint[i].faction == TEAM_ALLIANCE ? LANG_BG_IC_ALLIANCE : LANG_BG_IC_HORDE), nodePoint[i].string);
|
||||
|
||||
nodePoint[i].needChange = false;
|
||||
nodePoint[i].timer = BANNER_STATE_CHANGE_TIME;
|
||||
|
|
@ -543,7 +543,7 @@ void BattlegroundIC::HandleKillPlayer(Player* player, Player* killer)
|
|||
|
||||
void BattlegroundIC::EndBattleground(TeamId winnerTeamId)
|
||||
{
|
||||
SendMessage2ToAll(LANG_BG_IC_TEAM_WINS, CHAT_MSG_BG_SYSTEM_NEUTRAL, NULL, (winnerTeamId == TEAM_ALLIANCE ? LANG_BG_IC_ALLIANCE : LANG_BG_IC_HORDE));
|
||||
SendMessage2ToAll(LANG_BG_IC_TEAM_WINS, CHAT_MSG_BG_SYSTEM_NEUTRAL, nullptr, (winnerTeamId == TEAM_ALLIANCE ? LANG_BG_IC_ALLIANCE : LANG_BG_IC_HORDE));
|
||||
Battleground::EndBattleground(winnerTeamId);
|
||||
}
|
||||
|
||||
|
|
@ -944,7 +944,7 @@ void BattlegroundIC::DestroyGate(Player* /*player*/, GameObject* go)
|
|||
}
|
||||
|
||||
TurnBosses(true);
|
||||
SendMessage2ToAll(lang_entry, CHAT_MSG_BG_SYSTEM_NEUTRAL, NULL, (teamId == TEAM_ALLIANCE ? LANG_BG_IC_HORDE_KEEP : LANG_BG_IC_ALLIANCE_KEEP));
|
||||
SendMessage2ToAll(lang_entry, CHAT_MSG_BG_SYSTEM_NEUTRAL, nullptr, (teamId == TEAM_ALLIANCE ? LANG_BG_IC_HORDE_KEEP : LANG_BG_IC_ALLIANCE_KEEP));
|
||||
}
|
||||
|
||||
void BattlegroundIC::EventPlayerDamagedGO(Player* /*player*/, GameObject* /*go*/, uint32 /*eventType*/)
|
||||
|
|
|
|||
|
|
@ -70,18 +70,18 @@ void BattlegroundWS::PostUpdateImpl(uint32 diff)
|
|||
RespawnFlagAfterDrop(TEAM_HORDE);
|
||||
break;
|
||||
case BG_WS_EVENT_BOTH_FLAGS_KEPT10:
|
||||
if (Player* player = ObjectAccessor::GetObjectInMap(GetFlagPickerGUID(TEAM_ALLIANCE), this->FindBgMap(), (Player*)NULL))
|
||||
if (Player* player = ObjectAccessor::GetObjectInMap(GetFlagPickerGUID(TEAM_ALLIANCE), this->FindBgMap(), (Player*)nullptr))
|
||||
player->CastSpell(player, BG_WS_SPELL_FOCUSED_ASSAULT, true);
|
||||
if (Player* player = ObjectAccessor::GetObjectInMap(GetFlagPickerGUID(TEAM_HORDE), this->FindBgMap(), (Player*)NULL))
|
||||
if (Player* player = ObjectAccessor::GetObjectInMap(GetFlagPickerGUID(TEAM_HORDE), this->FindBgMap(), (Player*)nullptr))
|
||||
player->CastSpell(player, BG_WS_SPELL_FOCUSED_ASSAULT, true);
|
||||
break;
|
||||
case BG_WS_EVENT_BOTH_FLAGS_KEPT15:
|
||||
if (Player* player = ObjectAccessor::GetObjectInMap(GetFlagPickerGUID(TEAM_ALLIANCE), this->FindBgMap(), (Player*)NULL))
|
||||
if (Player* player = ObjectAccessor::GetObjectInMap(GetFlagPickerGUID(TEAM_ALLIANCE), this->FindBgMap(), (Player*)nullptr))
|
||||
{
|
||||
player->RemoveAurasDueToSpell(BG_WS_SPELL_FOCUSED_ASSAULT);
|
||||
player->CastSpell(player, BG_WS_SPELL_BRUTAL_ASSAULT, true);
|
||||
}
|
||||
if (Player* player = ObjectAccessor::GetObjectInMap(GetFlagPickerGUID(TEAM_HORDE), this->FindBgMap(), (Player*)NULL))
|
||||
if (Player* player = ObjectAccessor::GetObjectInMap(GetFlagPickerGUID(TEAM_HORDE), this->FindBgMap(), (Player*)nullptr))
|
||||
{
|
||||
player->RemoveAurasDueToSpell(BG_WS_SPELL_FOCUSED_ASSAULT);
|
||||
player->CastSpell(player, BG_WS_SPELL_BRUTAL_ASSAULT, true);
|
||||
|
|
@ -540,12 +540,12 @@ uint32 BattlegroundWS::GetAssaultSpellId() const
|
|||
|
||||
void BattlegroundWS::RemoveAssaultAuras()
|
||||
{
|
||||
if (Player* player = ObjectAccessor::GetObjectInMap(GetFlagPickerGUID(TEAM_ALLIANCE), this->FindBgMap(), (Player*)NULL))
|
||||
if (Player* player = ObjectAccessor::GetObjectInMap(GetFlagPickerGUID(TEAM_ALLIANCE), this->FindBgMap(), (Player*)nullptr))
|
||||
{
|
||||
player->RemoveAurasDueToSpell(BG_WS_SPELL_FOCUSED_ASSAULT);
|
||||
player->RemoveAurasDueToSpell(BG_WS_SPELL_BRUTAL_ASSAULT);
|
||||
}
|
||||
if (Player* player = ObjectAccessor::GetObjectInMap(GetFlagPickerGUID(TEAM_HORDE), this->FindBgMap(), (Player*)NULL))
|
||||
if (Player* player = ObjectAccessor::GetObjectInMap(GetFlagPickerGUID(TEAM_HORDE), this->FindBgMap(), (Player*)nullptr))
|
||||
{
|
||||
player->RemoveAurasDueToSpell(BG_WS_SPELL_FOCUSED_ASSAULT);
|
||||
player->RemoveAurasDueToSpell(BG_WS_SPELL_BRUTAL_ASSAULT);
|
||||
|
|
|
|||
|
|
@ -401,7 +401,7 @@ CalendarEventStore CalendarMgr::GetPlayerEvents(uint64 guid)
|
|||
for (CalendarEventInviteStore::const_iterator itr = _invites.begin(); itr != _invites.end(); ++itr)
|
||||
for (CalendarInviteStore::const_iterator itr2 = itr->second.begin(); itr2 != itr->second.end(); ++itr2)
|
||||
if ((*itr2)->GetInviteeGUID() == guid)
|
||||
if (CalendarEvent* event = GetEvent(itr->first)) // NULL check added as attempt to fix #11512
|
||||
if (CalendarEvent* event = GetEvent(itr->first)) // nullptr check added as attempt to fix #11512
|
||||
events.insert(event);
|
||||
|
||||
if (Player* player = ObjectAccessor::FindPlayerInOrOutOfWorld(guid))
|
||||
|
|
@ -665,7 +665,7 @@ void CalendarMgr::SendCalendarClearPendingAction(uint64 guid)
|
|||
}
|
||||
}
|
||||
|
||||
void CalendarMgr::SendCalendarCommandResult(uint64 guid, CalendarError err, char const* param /*= NULL*/)
|
||||
void CalendarMgr::SendCalendarCommandResult(uint64 guid, CalendarError err, char const* param /*= nullptr*/)
|
||||
{
|
||||
if (Player* player = ObjectAccessor::FindPlayerInOrOutOfWorld(guid))
|
||||
{
|
||||
|
|
|
|||
|
|
@ -116,7 +116,7 @@ bool ChatHandler::HasLowerSecurityAccount(WorldSession* target, uint32 target_ac
|
|||
else if (target_account)
|
||||
target_sec = AccountMgr::GetSecurity(target_account, realmID);
|
||||
else
|
||||
return true; // caller must report error for (target == NULL && target_account == 0)
|
||||
return true; // caller must report error for (target == nullptr && target_account == 0)
|
||||
|
||||
AccountTypes target_ac_sec = AccountTypes(target_sec);
|
||||
if (m_session->GetSecurity() < target_ac_sec || (strong && m_session->GetSecurity() <= target_ac_sec))
|
||||
|
|
@ -276,7 +276,7 @@ bool ChatHandler::ExecuteCommandInTable(std::vector<ChatCommand> const& table, c
|
|||
if (!ExecuteCommandInTable(table[i].ChildCommands, text, fullcmd.c_str()))
|
||||
{
|
||||
#ifdef ELUNA
|
||||
if (!sEluna->OnCommand(GetSession() ? GetSession()->GetPlayer() : NULL, oldtext))
|
||||
if (!sEluna->OnCommand(GetSession() ? GetSession()->GetPlayer() : nullptr, oldtext))
|
||||
return true;
|
||||
#endif
|
||||
if (text[0] != '\0')
|
||||
|
|
@ -429,7 +429,7 @@ bool ChatHandler::ParseCommands(char const* text)
|
|||
if (!ExecuteCommandInTable(getCommandTable(), text, fullcmd))
|
||||
{
|
||||
#ifdef ELUNA
|
||||
if (!sEluna->OnCommand(GetSession() ? GetSession()->GetPlayer() : NULL, text))
|
||||
if (!sEluna->OnCommand(GetSession() ? GetSession()->GetPlayer() : nullptr, text))
|
||||
return true;
|
||||
#endif
|
||||
if (m_session && AccountMgr::IsPlayerAccount(m_session->GetSecurity()))
|
||||
|
|
@ -1084,7 +1084,7 @@ std::string ChatHandler::extractPlayerNameFromLink(char* text)
|
|||
return name;
|
||||
}
|
||||
|
||||
bool ChatHandler::extractPlayerTarget(char* args, Player** player, uint64* player_guid /*=NULL*/, std::string* player_name /*= NULL*/)
|
||||
bool ChatHandler::extractPlayerTarget(char* args, Player** player, uint64* player_guid /*=nullptr*/, std::string* player_name /*= nullptr*/)
|
||||
{
|
||||
if (args && *args)
|
||||
{
|
||||
|
|
@ -1171,7 +1171,7 @@ char* ChatHandler::extractQuotedArg(char* args)
|
|||
continue;
|
||||
}
|
||||
|
||||
// return NULL if we reached the end of the string
|
||||
// return nullptr if we reached the end of the string
|
||||
if (!*args)
|
||||
return nullptr;
|
||||
|
||||
|
|
|
|||
|
|
@ -93,7 +93,7 @@ public:
|
|||
char* extractKeyFromLink(char* text, char const* linkType, char** something1 = nullptr);
|
||||
char* extractKeyFromLink(char* text, char const* const* linkTypes, int* found_idx, char** something1 = nullptr);
|
||||
|
||||
// if args have single value then it return in arg2 and arg1 == NULL
|
||||
// if args have single value then it return in arg2 and arg1 == nullptr
|
||||
void extractOptFirstArg(char* args, char** arg1, char** arg2);
|
||||
char* extractQuotedArg(char* args);
|
||||
|
||||
|
|
@ -103,7 +103,7 @@ public:
|
|||
bool GetPlayerGroupAndGUIDByName(const char* cname, Player*& player, Group*& group, uint64& guid, bool offline = false);
|
||||
std::string extractPlayerNameFromLink(char* text);
|
||||
// select by arg (name/link) or in-game selection online/offline player
|
||||
bool extractPlayerTarget(char* args, Player** player, uint64* player_guid = NULL, std::string* player_name = nullptr);
|
||||
bool extractPlayerTarget(char* args, Player** player, uint64* player_guid = nullptr, std::string* player_name = nullptr);
|
||||
|
||||
std::string playerLink(std::string const& name) const { return m_session ? "|cffffffff|Hplayer:" + name + "|h[" + name + "]|h|r" : name; }
|
||||
std::string GetNameLink(Player* chr) const;
|
||||
|
|
@ -123,7 +123,7 @@ protected:
|
|||
bool ShowHelpForSubCommands(std::vector<ChatCommand> const& table, char const* cmd, char const* subcmd);
|
||||
|
||||
private:
|
||||
WorldSession* m_session; // != NULL for chat command call and NULL for CLI command
|
||||
WorldSession* m_session; // != nullptr for chat command call and nullptr for CLI command
|
||||
|
||||
// common global flag
|
||||
static bool load_command_table;
|
||||
|
|
|
|||
|
|
@ -173,7 +173,7 @@ bool ItemChatLink::Initialize(std::istringstream& iss)
|
|||
inline std::string ItemChatLink::FormatName(uint8 index, ItemLocale const* locale, char* const* suffixStrings) const
|
||||
{
|
||||
std::stringstream ss;
|
||||
if (locale == NULL || index >= locale->Name.size())
|
||||
if (locale == nullptr || index >= locale->Name.size())
|
||||
ss << _item->Name1;
|
||||
else
|
||||
ss << locale->Name[index];
|
||||
|
|
@ -188,7 +188,7 @@ bool ItemChatLink::ValidateName(char* buffer, const char* context)
|
|||
|
||||
char* const* suffixStrings = _suffix ? _suffix->nameSuffix : (_property ? _property->nameSuffix : nullptr);
|
||||
|
||||
bool res = (FormatName(LOCALE_enUS, NULL, suffixStrings) == buffer);
|
||||
bool res = (FormatName(LOCALE_enUS, nullptr, suffixStrings) == buffer);
|
||||
|
||||
if (!res)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -238,7 +238,7 @@ void ThreatContainer::clearReferences()
|
|||
}
|
||||
|
||||
//============================================================
|
||||
// Return the HostileReference of NULL, if not found
|
||||
// Return the HostileReference of nullptr, if not found
|
||||
HostileReference* ThreatContainer::getReferenceByTarget(Unit* victim) const
|
||||
{
|
||||
if (!victim)
|
||||
|
|
@ -338,7 +338,7 @@ HostileReference* ThreatContainer::selectNextVictim(Creature* attacker, HostileR
|
|||
// pussywizard: skip not valid targets
|
||||
if (attacker->_CanDetectFeignDeathOf(target) && attacker->CanCreatureAttack(target))
|
||||
{
|
||||
if (currentVictim) // pussywizard: if not NULL then target must have 10%/30% more threat
|
||||
if (currentVictim) // pussywizard: if not nullptr then target must have 10%/30% more threat
|
||||
{
|
||||
if (currentVictim == currentRef) // pussywizard: nothing found previously was good and enough, currentRef passed all necessary tests, so end now
|
||||
{
|
||||
|
|
@ -460,7 +460,7 @@ Unit* ThreatManager::getHostilTarget()
|
|||
iThreatContainer.update();
|
||||
HostileReference* nextVictim = iThreatContainer.selectNextVictim(GetOwner()->ToCreature(), getCurrentVictim());
|
||||
setCurrentVictim(nextVictim);
|
||||
return getCurrentVictim() != NULL ? getCurrentVictim()->getTarget() : nullptr;
|
||||
return getCurrentVictim() != nullptr ? getCurrentVictim()->getTarget() : nullptr;
|
||||
}
|
||||
|
||||
//============================================================
|
||||
|
|
|
|||
|
|
@ -36,7 +36,7 @@ enum UNIT_EVENT_TYPE
|
|||
// New target should be fetched, could tbe the current target as well
|
||||
UEV_THREAT_SET_NEXT_TARGET = 1 << 5,
|
||||
|
||||
// A new victim (target) was set. Could be NULL
|
||||
// A new victim (target) was set. Could be nullptr
|
||||
UEV_THREAT_VICTIM_CHANGED = 1 << 6,
|
||||
|
||||
// Future use
|
||||
|
|
|
|||
|
|
@ -570,7 +570,7 @@ namespace lfg
|
|||
else
|
||||
{
|
||||
uint8 memberCount = 0;
|
||||
for (GroupReference* itr = grp->GetFirstMember(); itr != NULL && joinData.result == LFG_JOIN_OK; itr = itr->next())
|
||||
for (GroupReference* itr = grp->GetFirstMember(); itr != nullptr && joinData.result == LFG_JOIN_OK; itr = itr->next())
|
||||
{
|
||||
if (Player* plrg = itr->GetSource())
|
||||
{
|
||||
|
|
@ -598,7 +598,7 @@ namespace lfg
|
|||
joinData.result = LFG_JOIN_RANDOM_COOLDOWN;
|
||||
else if (grp)
|
||||
{
|
||||
for (GroupReference* itr = grp->GetFirstMember(); itr != NULL && joinData.result == LFG_JOIN_OK; itr = itr->next())
|
||||
for (GroupReference* itr = grp->GetFirstMember(); itr != nullptr && joinData.result == LFG_JOIN_OK; itr = itr->next())
|
||||
if (Player* plrg = itr->GetSource())
|
||||
if (plrg->HasAura(LFG_SPELL_DUNGEON_COOLDOWN)) // xinef: added !isContinue
|
||||
joinData.result = LFG_JOIN_PARTY_RANDOM_COOLDOWN;
|
||||
|
|
@ -733,7 +733,7 @@ namespace lfg
|
|||
|
||||
/**
|
||||
Leaves Dungeon System. Player/Group is removed from queue, rolechecks, proposals
|
||||
or votekicks. Player or group needs to be not NULL and using Dungeon System
|
||||
or votekicks. Player or group needs to be not nullptr and using Dungeon System
|
||||
|
||||
@param[in] guid Player or group guid
|
||||
*/
|
||||
|
|
@ -2085,7 +2085,7 @@ namespace lfg
|
|||
|
||||
// if we can take the quest, means that we haven't done this kind of "run", IE: First Heroic Random of Day.
|
||||
if (player->CanRewardQuest(quest, false))
|
||||
player->RewardQuest(quest, 0, NULL, false);
|
||||
player->RewardQuest(quest, 0, nullptr, false);
|
||||
else
|
||||
{
|
||||
done = true;
|
||||
|
|
@ -2093,7 +2093,7 @@ namespace lfg
|
|||
if (!quest)
|
||||
continue;
|
||||
// we give reward without informing client (retail does this)
|
||||
player->RewardQuest(quest, 0, NULL, false);
|
||||
player->RewardQuest(quest, 0, nullptr, false);
|
||||
}
|
||||
|
||||
// Give rewards
|
||||
|
|
|
|||
|
|
@ -1051,7 +1051,7 @@ void Creature::SetLootRecipient(Unit* unit, bool withGroup)
|
|||
{
|
||||
// set the player whose group should receive the right
|
||||
// to loot the creature after it dies
|
||||
// should be set to NULL after the loot disappears
|
||||
// should be set to nullptr after the loot disappears
|
||||
|
||||
if (!unit)
|
||||
{
|
||||
|
|
@ -2387,7 +2387,7 @@ void Creature::SendZoneUnderAttackMessage(Player* attacker)
|
|||
{
|
||||
WorldPacket data(SMSG_ZONE_UNDER_ATTACK, 4);
|
||||
data << (uint32)GetAreaId();
|
||||
sWorld->SendGlobalMessage(&data, NULL, (attacker->GetTeamId() == TEAM_ALLIANCE ? TEAM_HORDE : TEAM_ALLIANCE));
|
||||
sWorld->SendGlobalMessage(&data, nullptr, (attacker->GetTeamId() == TEAM_ALLIANCE ? TEAM_HORDE : TEAM_ALLIANCE));
|
||||
}
|
||||
|
||||
void Creature::SetInCombatWithZone()
|
||||
|
|
|
|||
|
|
@ -1212,7 +1212,7 @@ void GameObject::ResetDoorOrButton()
|
|||
m_cooldownTime = 0;
|
||||
}
|
||||
|
||||
void GameObject::UseDoorOrButton(uint32 time_to_restore, bool alternative /* = false */, Unit* user /*=NULL*/)
|
||||
void GameObject::UseDoorOrButton(uint32 time_to_restore, bool alternative /* = false */, Unit* user /*=nullptr*/)
|
||||
{
|
||||
if (m_lootState != GO_READY)
|
||||
return;
|
||||
|
|
@ -1667,7 +1667,7 @@ void GameObject::Use(Unit* user)
|
|||
|
||||
if (info->spellcaster.partyOnly)
|
||||
{
|
||||
Player const* caster = ObjectAccessor::GetObjectInOrOutOfWorld(GetOwnerGUID(), (Player*)NULL);
|
||||
Player const* caster = ObjectAccessor::GetObjectInOrOutOfWorld(GetOwnerGUID(), (Player*)nullptr);
|
||||
if (!caster || user->GetTypeId() != TYPEID_PLAYER || !user->ToPlayer()->IsInSameRaidWith(caster))
|
||||
return;
|
||||
}
|
||||
|
|
@ -2029,7 +2029,7 @@ void GameObject::SetWorldRotationAngles(float z_rot, float y_rot, float x_rot)
|
|||
SetWorldRotation(G3D::Quat(G3D::Matrix3::fromEulerAnglesZYX(z_rot, y_rot, x_rot)));
|
||||
}
|
||||
|
||||
void GameObject::ModifyHealth(int32 change, Unit* attackerOrHealer /*= NULL*/, uint32 spellId /*= 0*/)
|
||||
void GameObject::ModifyHealth(int32 change, Unit* attackerOrHealer /*= nullptr*/, uint32 spellId /*= 0*/)
|
||||
{
|
||||
if (!IsDestructibleBuilding())
|
||||
return;
|
||||
|
|
@ -2085,7 +2085,7 @@ void GameObject::ModifyHealth(int32 change, Unit* attackerOrHealer /*= NULL*/, u
|
|||
SetDestructibleState(newState, player, false);
|
||||
}
|
||||
|
||||
void GameObject::SetDestructibleState(GameObjectDestructibleState state, Player* eventInvoker /*= NULL*/, bool setHealth /*= false*/)
|
||||
void GameObject::SetDestructibleState(GameObjectDestructibleState state, Player* eventInvoker /*= nullptr*/, bool setHealth /*= false*/)
|
||||
{
|
||||
// the user calling this must know he is already operating on destructible gameobject
|
||||
ASSERT(GetGoType() == GAMEOBJECT_TYPE_DESTRUCTIBLE_BUILDING);
|
||||
|
|
@ -2303,7 +2303,7 @@ void GameObject::SetLootRecipient(Unit* unit)
|
|||
{
|
||||
// set the player whose group should receive the right
|
||||
// to loot the creature after it dies
|
||||
// should be set to NULL after the loot disappears
|
||||
// should be set to nullptr after the loot disappears
|
||||
|
||||
if (!unit)
|
||||
{
|
||||
|
|
@ -2437,7 +2437,7 @@ void GameObject::BuildValuesUpdate(uint8 updateType, ByteBuffer* data, Player* t
|
|||
data->append(fieldBuffer);
|
||||
}
|
||||
|
||||
void GameObject::GetRespawnPosition(float& x, float& y, float& z, float* ori /* = NULL*/) const
|
||||
void GameObject::GetRespawnPosition(float& x, float& y, float& z, float* ori /* = nullptr*/) const
|
||||
{
|
||||
if (m_DBTableGuid)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -91,7 +91,7 @@ void AddItemsSetItem(Player* player, Item* item)
|
|||
}
|
||||
|
||||
// spell casted only if fit form requirement, in other case will casted at form change
|
||||
player->ApplyEquipSpell(spellInfo, NULL, true);
|
||||
player->ApplyEquipSpell(spellInfo, nullptr, true);
|
||||
eff->spells[y] = spellInfo;
|
||||
break;
|
||||
}
|
||||
|
|
@ -142,8 +142,8 @@ void RemoveItemsSetItem(Player* player, ItemTemplate const* proto)
|
|||
if (eff->spells[z] && eff->spells[z]->Id == set->spells[x])
|
||||
{
|
||||
// spell can be not active if not fit form requirement
|
||||
player->ApplyEquipSpell(eff->spells[z], NULL, false);
|
||||
eff->spells[z] = NULL;
|
||||
player->ApplyEquipSpell(eff->spells[z], nullptr, false);
|
||||
eff->spells[z] = nullptr;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
|
@ -1075,7 +1075,7 @@ Item* Item::CreateItem(uint32 item, uint32 count, Player const* player, bool clo
|
|||
|
||||
Item* Item::CloneItem(uint32 count, Player const* player) const
|
||||
{
|
||||
// player CAN be NULL in which case we must not update random properties because that accesses player's item update queue
|
||||
// player CAN be nullptr in which case we must not update random properties because that accesses player's item update queue
|
||||
Item* newItem = CreateItem(GetEntry(), count, player, true, player ? GetItemRandomPropertyId() : 0);
|
||||
if (!newItem)
|
||||
return nullptr;
|
||||
|
|
@ -1143,7 +1143,7 @@ void Item::DeleteRefundDataFromDB(SQLTransaction* trans)
|
|||
}
|
||||
}
|
||||
|
||||
void Item::SetNotRefundable(Player* owner, bool changestate /*=true*/, SQLTransaction* trans /*=NULL*/)
|
||||
void Item::SetNotRefundable(Player* owner, bool changestate /*=true*/, SQLTransaction* trans /*=nullptr*/)
|
||||
{
|
||||
if (!HasFlag(ITEM_FIELD_FLAGS, ITEM_FIELD_FLAG_REFUNDABLE))
|
||||
return;
|
||||
|
|
|
|||
|
|
@ -2201,7 +2201,7 @@ void WorldObject::AddObjectToRemoveList()
|
|||
map->AddObjectToRemoveList(this);
|
||||
}
|
||||
|
||||
TempSummon* Map::SummonCreature(uint32 entry, Position const& pos, SummonPropertiesEntry const* properties /*= NULL*/, uint32 duration /*= 0*/, Unit* summoner /*= NULL*/, uint32 spellId /*= 0*/, uint32 vehId /*= 0*/)
|
||||
TempSummon* Map::SummonCreature(uint32 entry, Position const& pos, SummonPropertiesEntry const* properties /*= nullptr*/, uint32 duration /*= 0*/, Unit* summoner /*= nullptr*/, uint32 spellId /*= 0*/, uint32 vehId /*= 0*/)
|
||||
{
|
||||
uint32 mask = UNIT_MASK_SUMMON;
|
||||
if (properties)
|
||||
|
|
@ -2305,14 +2305,14 @@ TempSummon* Map::SummonCreature(uint32 entry, Position const& pos, SummonPropert
|
|||
* @param list List to store pointers to summoned creatures.
|
||||
*/
|
||||
|
||||
void Map::SummonCreatureGroup(uint8 group, std::list<TempSummon*>* list /*= NULL*/)
|
||||
void Map::SummonCreatureGroup(uint8 group, std::list<TempSummon*>* list /*= nullptr*/)
|
||||
{
|
||||
std::vector<TempSummonData> const* data = sObjectMgr->GetSummonGroup(GetId(), SUMMONER_TYPE_MAP, group);
|
||||
if (!data)
|
||||
return;
|
||||
|
||||
for (std::vector<TempSummonData>::const_iterator itr = data->begin(); itr != data->end(); ++itr)
|
||||
if (TempSummon* summon = SummonCreature(itr->entry, itr->pos, NULL, itr->time))
|
||||
if (TempSummon* summon = SummonCreature(itr->entry, itr->pos, nullptr, itr->time))
|
||||
if (list)
|
||||
list->push_back(summon);
|
||||
}
|
||||
|
|
@ -2437,7 +2437,7 @@ Creature* WorldObject::SummonTrigger(float x, float y, float z, float ang, uint3
|
|||
* @param group Id of group to summon.
|
||||
* @param list List to store pointers to summoned creatures.
|
||||
*/
|
||||
void WorldObject::SummonCreatureGroup(uint8 group, std::list<TempSummon*>* list /*= NULL*/)
|
||||
void WorldObject::SummonCreatureGroup(uint8 group, std::list<TempSummon*>* list /*= nullptr*/)
|
||||
{
|
||||
ASSERT((GetTypeId() == TYPEID_GAMEOBJECT || GetTypeId() == TYPEID_UNIT) && "Only GOs and creatures can summon npc groups!");
|
||||
|
||||
|
|
@ -2850,7 +2850,7 @@ void WorldObject::SetPhaseMask(uint32 newPhaseMask, bool update)
|
|||
UpdateObjectVisibility();
|
||||
}
|
||||
|
||||
void WorldObject::PlayDistanceSound(uint32 sound_id, Player* target /*= NULL*/)
|
||||
void WorldObject::PlayDistanceSound(uint32 sound_id, Player* target /*= nullptr*/)
|
||||
{
|
||||
WorldPacket data(SMSG_PLAY_OBJECT_SOUND, 4 + 8);
|
||||
data << uint32(sound_id);
|
||||
|
|
@ -2861,7 +2861,7 @@ void WorldObject::PlayDistanceSound(uint32 sound_id, Player* target /*= NULL*/)
|
|||
SendMessageToSet(&data, true);
|
||||
}
|
||||
|
||||
void WorldObject::PlayDirectSound(uint32 sound_id, Player* target /*= NULL*/)
|
||||
void WorldObject::PlayDirectSound(uint32 sound_id, Player* target /*= nullptr*/)
|
||||
{
|
||||
WorldPacket data(SMSG_PLAY_SOUND, 4);
|
||||
data << uint32(sound_id);
|
||||
|
|
@ -2871,7 +2871,7 @@ void WorldObject::PlayDirectSound(uint32 sound_id, Player* target /*= NULL*/)
|
|||
SendMessageToSet(&data, true);
|
||||
}
|
||||
|
||||
void WorldObject::PlayDirectMusic(uint32 music_id, Player* target /*= NULL*/)
|
||||
void WorldObject::PlayDirectMusic(uint32 music_id, Player* target /*= nullptr*/)
|
||||
{
|
||||
WorldPacket data(SMSG_PLAY_MUSIC, 4);
|
||||
data << uint32(music_id);
|
||||
|
|
@ -2997,7 +2997,7 @@ struct WorldObjectChangeAccumulator
|
|||
|
||||
if (IS_PLAYER_GUID(guid))
|
||||
{
|
||||
//Caster may be NULL if DynObj is in removelist
|
||||
//Caster may be nullptr if DynObj is in removelist
|
||||
if (Player* caster = ObjectAccessor::FindPlayer(guid))
|
||||
if (caster->GetUInt64Value(PLAYER_FARSIGHT) == source->GetGUID())
|
||||
BuildPacket(caster);
|
||||
|
|
|
|||
|
|
@ -1268,7 +1268,7 @@ void Pet::_LoadAuras(PreparedQueryResult result, uint32 timediff)
|
|||
int32 baseDamage[3];
|
||||
Field* fields = result->Fetch();
|
||||
uint64 caster_guid = fields[0].GetUInt64();
|
||||
// NULL guid stored - pet is the caster of the spell - see Pet::_SaveAuras
|
||||
// nullptr guid stored - pet is the caster of the spell - see Pet::_SaveAuras
|
||||
if (!caster_guid)
|
||||
caster_guid = GetGUID();
|
||||
uint32 spellid = fields[1].GetUInt32();
|
||||
|
|
@ -1319,7 +1319,7 @@ void Pet::_LoadAuras(PreparedQueryResult result, uint32 timediff)
|
|||
else
|
||||
remaincharges = 0;
|
||||
|
||||
if (Aura* aura = Aura::TryCreate(spellInfo, effmask, this, NULL, &baseDamage[0], NULL, caster_guid))
|
||||
if (Aura* aura = Aura::TryCreate(spellInfo, effmask, this, nullptr, &baseDamage[0], nullptr, caster_guid))
|
||||
{
|
||||
if (!aura->CanBeSaved())
|
||||
{
|
||||
|
|
@ -1781,7 +1781,7 @@ bool Pet::resetTalents()
|
|||
return true;
|
||||
}
|
||||
|
||||
void Pet::resetTalentsForAllPetsOf(Player* owner, Pet* online_pet /*= NULL*/)
|
||||
void Pet::resetTalentsForAllPetsOf(Player* owner, Pet* online_pet /*= nullptr*/)
|
||||
{
|
||||
// not need after this call
|
||||
if (owner->ToPlayer()->HasAtLoginFlag(AT_LOGIN_RESET_PET_TALENTS))
|
||||
|
|
@ -2237,7 +2237,7 @@ void Pet::HandleAsynchLoadFailed(AsynchPetSummon* info, Player* player, uint8 as
|
|||
// we are almost at home...
|
||||
if (asynchLoadType == PET_LOAD_SUMMON_PET)
|
||||
{
|
||||
Unit* caster = ObjectAccessor::GetObjectInMap(info->m_casterGUID, map, (Unit*)NULL);
|
||||
Unit* caster = ObjectAccessor::GetObjectInMap(info->m_casterGUID, map, (Unit*)nullptr);
|
||||
if (!caster)
|
||||
caster = player;
|
||||
|
||||
|
|
|
|||
|
|
@ -126,7 +126,7 @@ void Totem::UnSummon(uint32 msTime)
|
|||
player->SendAutoRepeatCancel(this);
|
||||
|
||||
if (SpellInfo const* spell = sSpellMgr->GetSpellInfo(GetUInt32Value(UNIT_CREATED_BY_SPELL)))
|
||||
player->SendCooldownEvent(spell, 0, NULL, false);
|
||||
player->SendCooldownEvent(spell, 0, nullptr, false);
|
||||
|
||||
if (Group* group = player->GetGroup())
|
||||
{
|
||||
|
|
|
|||
|
|
@ -837,7 +837,7 @@ void StaticTransport::Update(uint32 diff)
|
|||
|
||||
void StaticTransport::RelocateToProgress(uint32 progress)
|
||||
{
|
||||
TransportAnimationEntry const* curr = NULL, *next = nullptr;
|
||||
TransportAnimationEntry const* curr = nullptr, *next = nullptr;
|
||||
float percPos;
|
||||
if (m_goValue.Transport.AnimationInfo->GetAnimNode(progress, curr, next, percPos))
|
||||
{
|
||||
|
|
|
|||
|
|
@ -1224,9 +1224,9 @@ void Unit::CalculateSpellDamageTaken(SpellNonMeleeDamage* damageInfo, int32 dama
|
|||
if (CanApplyResilience())
|
||||
{
|
||||
if (attackType != RANGED_ATTACK)
|
||||
Unit::ApplyResilience(victim, NULL, &damage, crit, CR_CRIT_TAKEN_MELEE);
|
||||
Unit::ApplyResilience(victim, nullptr, &damage, crit, CR_CRIT_TAKEN_MELEE);
|
||||
else
|
||||
Unit::ApplyResilience(victim, NULL, &damage, crit, CR_CRIT_TAKEN_RANGED);
|
||||
Unit::ApplyResilience(victim, nullptr, &damage, crit, CR_CRIT_TAKEN_RANGED);
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
|
@ -1242,7 +1242,7 @@ void Unit::CalculateSpellDamageTaken(SpellNonMeleeDamage* damageInfo, int32 dama
|
|||
}
|
||||
|
||||
if (CanApplyResilience())
|
||||
Unit::ApplyResilience(victim, NULL, &damage, crit, CR_CRIT_TAKEN_SPELL);
|
||||
Unit::ApplyResilience(victim, nullptr, &damage, crit, CR_CRIT_TAKEN_SPELL);
|
||||
break;
|
||||
}
|
||||
default:
|
||||
|
|
@ -1354,7 +1354,7 @@ void Unit::CalculateMeleeDamage(Unit* victim, uint32 damage, CalcDamageInfo* dam
|
|||
// Calculate armor reduction
|
||||
if (IsDamageReducedByArmor((SpellSchoolMask)(damageInfo->damageSchoolMask)))
|
||||
{
|
||||
damageInfo->damage = Unit::CalcArmorReducedDamage(this, damageInfo->target, damage, NULL, 0, damageInfo->attackType);
|
||||
damageInfo->damage = Unit::CalcArmorReducedDamage(this, damageInfo->target, damage, nullptr, 0, damageInfo->attackType);
|
||||
damageInfo->cleanDamage += damage - damageInfo->damage;
|
||||
}
|
||||
else
|
||||
|
|
@ -1473,7 +1473,7 @@ void Unit::CalculateMeleeDamage(Unit* victim, uint32 damage, CalcDamageInfo* dam
|
|||
|
||||
// attackType is checked already for BASE_ATTACK or OFF_ATTACK so it can't be RANGED_ATTACK here
|
||||
if (CanApplyResilience())
|
||||
Unit::ApplyResilience(victim, NULL, &resilienceReduction, (damageInfo->hitOutCome == MELEE_HIT_CRIT), CR_CRIT_TAKEN_MELEE);
|
||||
Unit::ApplyResilience(victim, nullptr, &resilienceReduction, (damageInfo->hitOutCome == MELEE_HIT_CRIT), CR_CRIT_TAKEN_MELEE);
|
||||
|
||||
resilienceReduction = damageInfo->damage - resilienceReduction;
|
||||
damageInfo->damage -= resilienceReduction;
|
||||
|
|
@ -1548,7 +1548,7 @@ void Unit::DealMeleeDamage(CalcDamageInfo* damageInfo, bool durabilityLoss)
|
|||
|
||||
// Call default DealDamage
|
||||
CleanDamage cleanDamage(damageInfo->cleanDamage, damageInfo->absorb, damageInfo->attackType, damageInfo->hitOutCome);
|
||||
Unit::DealDamage(this, victim, damageInfo->damage, &cleanDamage, DIRECT_DAMAGE, SpellSchoolMask(damageInfo->damageSchoolMask), NULL, durabilityLoss);
|
||||
Unit::DealDamage(this, victim, damageInfo->damage, &cleanDamage, DIRECT_DAMAGE, SpellSchoolMask(damageInfo->damageSchoolMask), nullptr, durabilityLoss);
|
||||
|
||||
// If this is a creature and it attacks from behind it has a probability to daze it's victim
|
||||
if (damageInfo->damage && ((damageInfo->hitOutCome == MELEE_HIT_CRIT || damageInfo->hitOutCome == MELEE_HIT_CRUSHING || damageInfo->hitOutCome == MELEE_HIT_NORMAL || damageInfo->hitOutCome == MELEE_HIT_GLANCING) &&
|
||||
|
|
@ -3214,9 +3214,9 @@ float Unit::GetUnitCriticalChance(WeaponAttackType attackType, const Unit* victi
|
|||
|
||||
// reduce crit chance from Rating for players
|
||||
if (attackType != RANGED_ATTACK)
|
||||
Unit::ApplyResilience(victim, &crit, NULL, false, CR_CRIT_TAKEN_MELEE);
|
||||
Unit::ApplyResilience(victim, &crit, nullptr, false, CR_CRIT_TAKEN_MELEE);
|
||||
else
|
||||
Unit::ApplyResilience(victim, &crit, NULL, false, CR_CRIT_TAKEN_RANGED);
|
||||
Unit::ApplyResilience(victim, &crit, nullptr, false, CR_CRIT_TAKEN_RANGED);
|
||||
|
||||
// Apply crit chance from defence skill
|
||||
crit += (int32(GetMaxSkillValueForLevel(victim)) - int32(victim->GetDefenseSkillValue(this))) * 0.04f;
|
||||
|
|
@ -3398,7 +3398,7 @@ void Unit::_UpdateAutoRepeatSpell()
|
|||
|
||||
void Unit::SetCurrentCastedSpell(Spell* pSpell)
|
||||
{
|
||||
ASSERT(pSpell); // NULL may be never passed here, use InterruptSpell or InterruptNonMeleeSpells
|
||||
ASSERT(pSpell); // nullptr may be never passed here, use InterruptSpell or InterruptNonMeleeSpells
|
||||
|
||||
CurrentSpellTypes CSpellType = pSpell->GetCurrentContainer();
|
||||
|
||||
|
|
@ -3936,7 +3936,7 @@ void Unit::DeMorph()
|
|||
SetDisplayId(GetNativeDisplayId());
|
||||
}
|
||||
|
||||
Aura* Unit::_TryStackingOrRefreshingExistingAura(SpellInfo const* newAura, uint8 effMask, Unit* caster, int32* baseAmount /*= NULL*/, Item* castItem /*= NULL*/, uint64 casterGUID /*= 0*/, bool periodicReset /*= false*/)
|
||||
Aura* Unit::_TryStackingOrRefreshingExistingAura(SpellInfo const* newAura, uint8 effMask, Unit* caster, int32* baseAmount /*= nullptr*/, Item* castItem /*= nullptr*/, uint64 casterGUID /*= 0*/, bool periodicReset /*= false*/)
|
||||
{
|
||||
ASSERT(casterGUID || caster);
|
||||
if (!casterGUID)
|
||||
|
|
@ -4570,7 +4570,7 @@ void Unit::RemoveAurasDueToSpellBySteal(uint32 spellId, uint64 casterGUID, Unit*
|
|||
// Xinef: if stealer has same aura
|
||||
Aura* curAura = stealer->GetAura(aura->GetId());
|
||||
if (!curAura || (!curAura->IsPermanent() && curAura->GetDuration() < (int32)dur))
|
||||
if (Aura* newAura = Aura::TryRefreshStackOrCreate(aura->GetSpellInfo(), effMask, stealer, NULL, &baseDamage[0], NULL, aura->GetCasterGUID()))
|
||||
if (Aura* newAura = Aura::TryRefreshStackOrCreate(aura->GetSpellInfo(), effMask, stealer, nullptr, &baseDamage[0], nullptr, aura->GetCasterGUID()))
|
||||
{
|
||||
// created aura must not be single target aura,, so stealer won't loose it on recast
|
||||
if (newAura->IsSingleTarget())
|
||||
|
|
@ -5657,7 +5657,7 @@ void Unit::AddGameObject(GameObject* gameObj)
|
|||
// Need disable spell use for owner
|
||||
if (createBySpell && createBySpell->IsCooldownStartedOnEvent())
|
||||
// note: item based cooldowns and cooldown spell mods with charges ignored (unknown existing cases)
|
||||
ToPlayer()->AddSpellAndCategoryCooldowns(createBySpell, 0, NULL, true);
|
||||
ToPlayer()->AddSpellAndCategoryCooldowns(createBySpell, 0, nullptr, true);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -5972,7 +5972,7 @@ void Unit::SendAttackStateUpdate(uint32 HitInfo, Unit* target, uint8 /*SwingType
|
|||
SendAttackStateUpdate(&dmgInfo);
|
||||
}
|
||||
|
||||
//victim may be NULL
|
||||
//victim may be nullptr
|
||||
bool Unit::HandleDummyAuraProc(Unit* victim, uint32 damage, AuraEffect* triggeredByAura, SpellInfo const* procSpell, uint32 procFlag, uint32 procEx, uint32 cooldown)
|
||||
{
|
||||
SpellInfo const* dummySpell = triggeredByAura->GetSpellInfo();
|
||||
|
|
@ -6726,7 +6726,7 @@ bool Unit::HandleDummyAuraProc(Unit* victim, uint32 damage, AuraEffect* triggere
|
|||
int32 total = CalculatePct(int32(damage), triggerAmount);
|
||||
int32 team = total / 5;
|
||||
int32 self = total - team;
|
||||
CastCustomSpell(this, 15290, &team, &self, NULL, true, castItem, triggeredByAura);
|
||||
CastCustomSpell(this, 15290, &team, &self, nullptr, true, castItem, triggeredByAura);
|
||||
return true; // no hidden cooldown
|
||||
}
|
||||
// Priest Tier 6 Trinket (Ashtongue Talisman of Acumen)
|
||||
|
|
@ -7404,7 +7404,7 @@ bool Unit::HandleDummyAuraProc(Unit* victim, uint32 damage, AuraEffect* triggere
|
|||
if (!victim || !victim->IsAlive())
|
||||
return false;
|
||||
|
||||
CastSpell(this, 71432, true, NULL, triggeredByAura);
|
||||
CastSpell(this, 71432, true, nullptr, triggeredByAura);
|
||||
|
||||
Aura const* dummy = GetAura(71432);
|
||||
if (!dummy || dummy->GetStackAmount() < (dummySpell->Id == 71406 ? 8 : 7))
|
||||
|
|
@ -8104,7 +8104,7 @@ bool Unit::HandleDummyAuraProc(Unit* victim, uint32 damage, AuraEffect* triggere
|
|||
continue;
|
||||
|
||||
basepoints0 = int32(CalculateSpellDamage(this, procSpell, i) * 0.4f);
|
||||
CastCustomSpell(this, triggered_spell_id, &basepoints0, nullptr, nullptr, true, NULL, triggeredByAura);
|
||||
CastCustomSpell(this, triggered_spell_id, &basepoints0, nullptr, nullptr, true, nullptr, triggeredByAura);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
|
@ -8266,7 +8266,7 @@ bool Unit::HandleAuraProc(Unit* victim, uint32 damage, Aura* triggeredByAura, Sp
|
|||
return false;
|
||||
|
||||
int32 bp0 = int32(CalculatePct(GetMaxPower(POWER_MANA), spInfo->Effects[0].CalcValue()));
|
||||
CastCustomSpell(this, 67545, &bp0, nullptr, nullptr, true, NULL, triggeredByAura->GetEffect(EFFECT_0), GetGUID());
|
||||
CastCustomSpell(this, 67545, &bp0, nullptr, nullptr, true, nullptr, triggeredByAura->GetEffect(EFFECT_0), GetGUID());
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
|
@ -8707,14 +8707,14 @@ bool Unit::HandleProcTriggerSpell(Unit* victim, uint32 damage, AuraEffect* trigg
|
|||
ToPlayer()->AddSpellCooldown(stack_spell_id, 0, cooldown);
|
||||
}
|
||||
|
||||
CastSpell(this, stack_spell_id, true, NULL, triggeredByAura);
|
||||
CastSpell(this, stack_spell_id, true, nullptr, triggeredByAura);
|
||||
|
||||
Aura* dummy = GetAura(stack_spell_id);
|
||||
if (!dummy || dummy->GetStackAmount() < triggerAmount)
|
||||
return false;
|
||||
|
||||
RemoveAurasDueToSpell(stack_spell_id);
|
||||
CastSpell(victim, trigger_spell_id, true, NULL, triggeredByAura);
|
||||
CastSpell(victim, trigger_spell_id, true, nullptr, triggeredByAura);
|
||||
return true;
|
||||
}
|
||||
default:
|
||||
|
|
@ -9158,7 +9158,7 @@ bool Unit::HandleProcTriggerSpell(Unit* victim, uint32 damage, AuraEffect* trigg
|
|||
if (AuraEffect* aurEff = owner->GetDummyAuraEffect(SPELLFAMILY_WARLOCK, 3220, 0))
|
||||
{
|
||||
basepoints0 = int32((aurEff->GetAmount() * owner->SpellBaseDamageBonusDone(SpellSchoolMask(SPELL_SCHOOL_MASK_MAGIC)) + 100.0f) / 100.0f); // TODO: Is it right?
|
||||
CastCustomSpell(this, trigger_spell_id, &basepoints0, &basepoints0, NULL, true, castItem, triggeredByAura);
|
||||
CastCustomSpell(this, trigger_spell_id, &basepoints0, &basepoints0, nullptr, true, castItem, triggeredByAura);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
|
@ -9316,7 +9316,7 @@ bool Unit::HandleProcTriggerSpell(Unit* victim, uint32 damage, AuraEffect* trigg
|
|||
}
|
||||
|
||||
if(basepoints0)
|
||||
CastCustomSpell(target, triggerEntry->Id, &basepoints0, NULL, NULL, true, castItem, triggeredByAura);
|
||||
CastCustomSpell(target, triggerEntry->Id, &basepoints0, nullptr, nullptr, true, castItem, triggeredByAura);
|
||||
else
|
||||
CastSpell(target, triggerEntry->Id, true, castItem, triggeredByAura);
|
||||
|
||||
|
|
@ -10170,7 +10170,7 @@ void Unit::SetMinion(Minion* minion, bool apply)
|
|||
SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(minion->GetUInt32Value(UNIT_CREATED_BY_SPELL));
|
||||
|
||||
if (spellInfo && spellInfo->IsCooldownStartedOnEvent())
|
||||
ToPlayer()->AddSpellAndCategoryCooldowns(spellInfo, 0, NULL, true);
|
||||
ToPlayer()->AddSpellAndCategoryCooldowns(spellInfo, 0, nullptr, true);
|
||||
}
|
||||
}
|
||||
else
|
||||
|
|
@ -11417,7 +11417,7 @@ float Unit::SpellTakenCritChance(Unit const* caster, SpellInfo const* spellProto
|
|||
crit_chance += GetMaxPositiveAuraModifierByMiscMask(SPELL_AURA_MOD_ATTACKER_SPELL_CRIT_CHANCE, schoolMask);
|
||||
}
|
||||
|
||||
Unit::ApplyResilience(this, &crit_chance, NULL, false, CR_CRIT_TAKEN_SPELL);
|
||||
Unit::ApplyResilience(this, &crit_chance, nullptr, false, CR_CRIT_TAKEN_SPELL);
|
||||
}
|
||||
// scripted (increase crit chance ... against ... target by x%
|
||||
if (caster)
|
||||
|
|
@ -11560,10 +11560,10 @@ float Unit::SpellTakenCritChance(Unit const* caster, SpellInfo const* spellProto
|
|||
if (attackType != RANGED_ATTACK)
|
||||
{
|
||||
// xinef: little hack, crit chance dont require caster to calculate, pass victim
|
||||
Unit::ApplyResilience(this, &crit_chance, NULL, false, CR_CRIT_TAKEN_MELEE);
|
||||
Unit::ApplyResilience(this, &crit_chance, nullptr, false, CR_CRIT_TAKEN_MELEE);
|
||||
}
|
||||
else
|
||||
Unit::ApplyResilience(this, &crit_chance, NULL, false, CR_CRIT_TAKEN_RANGED);
|
||||
Unit::ApplyResilience(this, &crit_chance, nullptr, false, CR_CRIT_TAKEN_RANGED);
|
||||
|
||||
// Apply crit chance from defence skill
|
||||
if (caster)
|
||||
|
|
@ -15465,7 +15465,7 @@ void Unit::ProcDamageAndSpellFor(bool isVictim, Unit* target, uint32 procFlag, u
|
|||
|
||||
DamageInfo damageInfo = DamageInfo(actor, actionTarget, damage, procSpell, procSpell ? SpellSchoolMask(procSpell->SchoolMask) : SPELL_SCHOOL_MASK_NORMAL, SPELL_DIRECT_DAMAGE);
|
||||
HealInfo healInfo = HealInfo(actor, actionTarget, damage, procSpell, procSpell ? SpellSchoolMask(procSpell->SchoolMask) : SPELL_SCHOOL_MASK_NORMAL);
|
||||
ProcEventInfo eventInfo = ProcEventInfo(actor, actionTarget, target, procFlag, 0, 0, procExtra, NULL, &damageInfo, &healInfo, procAura);
|
||||
ProcEventInfo eventInfo = ProcEventInfo(actor, actionTarget, target, procFlag, 0, 0, procExtra, nullptr, &damageInfo, &healInfo, procAura);
|
||||
|
||||
ProcTriggeredList procTriggered;
|
||||
// Fill procTriggered list
|
||||
|
|
@ -15522,7 +15522,7 @@ void Unit::ProcDamageAndSpellFor(bool isVictim, Unit* target, uint32 procFlag, u
|
|||
// Skip this auras
|
||||
if (isNonTriggerAura[aurEff->GetAuraType()])
|
||||
continue;
|
||||
// If not trigger by default and spellProcEvent == NULL - skip
|
||||
// If not trigger by default and spellProcEvent == nullptr - skip
|
||||
if (!isTriggerAura[aurEff->GetAuraType()] && triggerData.spellProcEvent == nullptr)
|
||||
continue;
|
||||
// Some spells must always trigger
|
||||
|
|
@ -15808,7 +15808,7 @@ void Unit::GetProcAurasTriggeredOnEvent(std::list<AuraApplication*>& aurasTrigge
|
|||
void Unit::TriggerAurasProcOnEvent(CalcDamageInfo& damageInfo)
|
||||
{
|
||||
DamageInfo dmgInfo = DamageInfo(damageInfo);
|
||||
TriggerAurasProcOnEvent(nullptr, NULL, damageInfo.target, damageInfo.procAttacker, damageInfo.procVictim, 0, 0, damageInfo.procEx, NULL, &dmgInfo, nullptr);
|
||||
TriggerAurasProcOnEvent(nullptr, nullptr, damageInfo.target, damageInfo.procAttacker, damageInfo.procVictim, 0, 0, damageInfo.procEx, nullptr, &dmgInfo, nullptr);
|
||||
}
|
||||
|
||||
void Unit::TriggerAurasProcOnEvent(std::list<AuraApplication*>* myProcAuras, std::list<AuraApplication*>* targetProcAuras, Unit* actionTarget, uint32 typeMaskActor, uint32 typeMaskActionTarget, uint32 spellTypeMask, uint32 spellPhaseMask, uint32 hitMask, Spell* spell, DamageInfo* damageInfo, HealInfo* healInfo)
|
||||
|
|
@ -16706,7 +16706,7 @@ bool Unit::HandleAuraRaidProcFromChargeWithValue(AuraEffect* triggeredByAura)
|
|||
if (Unit* target = nearMembers.front())
|
||||
{
|
||||
CastSpell(target, 41637 /*Dummy visual effect triggered by main spell cast*/, true);
|
||||
CastCustomSpell(target, spellProto->Id, &heal, nullptr, nullptr, true, NULL, triggeredByAura, caster_guid);
|
||||
CastCustomSpell(target, spellProto->Id, &heal, nullptr, nullptr, true, nullptr, triggeredByAura, caster_guid);
|
||||
if (Aura* aura = target->GetAura(spellProto->Id, caster->GetGUID()))
|
||||
aura->SetCharges(jumps);
|
||||
}
|
||||
|
|
@ -16758,14 +16758,14 @@ bool Unit::HandleAuraRaidProcFromCharge(AuraEffect* triggeredByAura)
|
|||
float radius = triggeredByAura->GetSpellInfo()->Effects[triggeredByAura->GetEffIndex()].CalcRadius(caster);
|
||||
if (Unit* target = GetNextRandomRaidMemberOrPet(radius))
|
||||
{
|
||||
CastSpell(target, spellProto, true, NULL, triggeredByAura, caster_guid);
|
||||
CastSpell(target, spellProto, true, nullptr, triggeredByAura, caster_guid);
|
||||
if (Aura* aura = target->GetAura(spellProto->Id, caster->GetGUID()))
|
||||
aura->SetCharges(jumps);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
CastSpell(this, damageSpellId, true, NULL, triggeredByAura, caster_guid);
|
||||
CastSpell(this, damageSpellId, true, nullptr, triggeredByAura, caster_guid);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
|
@ -16938,7 +16938,7 @@ void Unit::Kill(Unit* killer, Unit* victim, bool durabilityLoss, WeaponAttackTyp
|
|||
victim->SetUInt32Value(PLAYER_SELF_RES_SPELL, ressSpellId);
|
||||
|
||||
// FORM_SPIRITOFREDEMPTION and related auras
|
||||
victim->CastSpell(victim, 27827, true, NULL, aurEff);
|
||||
victim->CastSpell(victim, 27827, true, nullptr, aurEff);
|
||||
spiritOfRedemption = true;
|
||||
}
|
||||
}
|
||||
|
|
@ -17336,7 +17336,7 @@ void Unit::SetFeared(bool apply)
|
|||
caster = ObjectAccessor::GetUnit(*this, fearAuras.front()->GetCasterGUID());
|
||||
if (!caster)
|
||||
caster = getAttackerForHelper();
|
||||
GetMotionMaster()->MoveFleeing(caster, fearAuras.empty() ? sWorld->getIntConfig(CONFIG_CREATURE_FAMILY_FLEE_DELAY) : 0); // caster == NULL processed in MoveFleeing
|
||||
GetMotionMaster()->MoveFleeing(caster, fearAuras.empty() ? sWorld->getIntConfig(CONFIG_CREATURE_FAMILY_FLEE_DELAY) : 0); // caster == nullptr processed in MoveFleeing
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
@ -18599,7 +18599,7 @@ bool Unit::HandleSpellClick(Unit* clicker, int8 seatId)
|
|||
bp0[j] = spellEntry->Effects[j].BasePoints;
|
||||
|
||||
bp0[i] = seatId;
|
||||
Aura::TryRefreshStackOrCreate(spellEntry, MAX_EFFECT_MASK, this, clicker, bp0, NULL, origCasterGUID);
|
||||
Aura::TryRefreshStackOrCreate(spellEntry, MAX_EFFECT_MASK, this, clicker, bp0, nullptr, origCasterGUID);
|
||||
}
|
||||
}
|
||||
else
|
||||
|
|
|
|||
|
|
@ -1274,11 +1274,11 @@ struct AttackPosition {
|
|||
{
|
||||
if (!val)
|
||||
{
|
||||
// _pos = NULL;
|
||||
// _pos = nullptr;
|
||||
_taken = false;
|
||||
return 0; // NULL
|
||||
return 0; // nullptr
|
||||
}
|
||||
return 0; // NULL
|
||||
return 0; // nullptr
|
||||
};
|
||||
Position _pos;
|
||||
bool _taken;
|
||||
|
|
|
|||
|
|
@ -65,7 +65,7 @@ private:
|
|||
void InitMovementInfoForBase();
|
||||
|
||||
/// This method transforms supplied transport offsets into global coordinates
|
||||
void CalculatePassengerPosition(float& x, float& y, float& z, float* o /*= NULL*/) const override
|
||||
void CalculatePassengerPosition(float& x, float& y, float& z, float* o /*= nullptr*/) const override
|
||||
{
|
||||
TransportBase::CalculatePassengerPosition(x, y, z, o,
|
||||
GetBase()->GetPositionX(), GetBase()->GetPositionY(),
|
||||
|
|
@ -73,7 +73,7 @@ private:
|
|||
}
|
||||
|
||||
/// This method transforms supplied global coordinates into local offsets
|
||||
void CalculatePassengerOffset(float& x, float& y, float& z, float* o /*= NULL*/) const override
|
||||
void CalculatePassengerOffset(float& x, float& y, float& z, float* o /*= nullptr*/) const override
|
||||
{
|
||||
TransportBase::CalculatePassengerOffset(x, y, z, o,
|
||||
GetBase()->GetPositionX(), GetBase()->GetPositionY(),
|
||||
|
|
|
|||
|
|
@ -1361,7 +1361,7 @@ void GameEventMgr::GameEventUnspawn(int16 event_id)
|
|||
{
|
||||
sObjectMgr->RemoveCreatureFromGrid(*itr, data);
|
||||
|
||||
if (Creature* creature = ObjectAccessor::GetObjectInWorld(MAKE_NEW_GUID(*itr, data->id, HIGHGUID_UNIT), (Creature*)NULL))
|
||||
if (Creature* creature = ObjectAccessor::GetObjectInWorld(MAKE_NEW_GUID(*itr, data->id, HIGHGUID_UNIT), (Creature*)nullptr))
|
||||
creature->AddObjectToRemoveList();
|
||||
}
|
||||
}
|
||||
|
|
@ -1383,7 +1383,7 @@ void GameEventMgr::GameEventUnspawn(int16 event_id)
|
|||
{
|
||||
sObjectMgr->RemoveGameobjectFromGrid(*itr, data);
|
||||
|
||||
if (GameObject* pGameobject = ObjectAccessor::GetObjectInWorld(MAKE_NEW_GUID(*itr, data->id, HIGHGUID_GAMEOBJECT), (GameObject*)NULL))
|
||||
if (GameObject* pGameobject = ObjectAccessor::GetObjectInWorld(MAKE_NEW_GUID(*itr, data->id, HIGHGUID_GAMEOBJECT), (GameObject*)nullptr))
|
||||
pGameobject->AddObjectToRemoveList();
|
||||
}
|
||||
}
|
||||
|
|
@ -1409,7 +1409,7 @@ void GameEventMgr::ChangeEquipOrModel(int16 event_id, bool activate)
|
|||
continue;
|
||||
|
||||
// Update if spawned
|
||||
Creature* creature = ObjectAccessor::GetObjectInWorld(MAKE_NEW_GUID(itr->first, data->id, HIGHGUID_UNIT), (Creature*)NULL);
|
||||
Creature* creature = ObjectAccessor::GetObjectInWorld(MAKE_NEW_GUID(itr->first, data->id, HIGHGUID_UNIT), (Creature*)nullptr);
|
||||
if (creature)
|
||||
{
|
||||
if (activate)
|
||||
|
|
|
|||
|
|
@ -110,12 +110,12 @@ Object* ObjectAccessor::GetObjectByTypeMask(WorldObject const& p, uint64 guid, u
|
|||
|
||||
Corpse* ObjectAccessor::GetCorpse(WorldObject const& u, uint64 guid)
|
||||
{
|
||||
return GetObjectInMap(guid, u.GetMap(), (Corpse*)NULL);
|
||||
return GetObjectInMap(guid, u.GetMap(), (Corpse*)nullptr);
|
||||
}
|
||||
|
||||
GameObject* ObjectAccessor::GetGameObject(WorldObject const& u, uint64 guid)
|
||||
{
|
||||
return GetObjectInMap(guid, u.GetMap(), (GameObject*)NULL);
|
||||
return GetObjectInMap(guid, u.GetMap(), (GameObject*)nullptr);
|
||||
}
|
||||
|
||||
Transport* ObjectAccessor::GetTransport(WorldObject const& u, uint64 guid)
|
||||
|
|
@ -129,27 +129,27 @@ Transport* ObjectAccessor::GetTransport(WorldObject const& u, uint64 guid)
|
|||
|
||||
DynamicObject* ObjectAccessor::GetDynamicObject(WorldObject const& u, uint64 guid)
|
||||
{
|
||||
return GetObjectInMap(guid, u.GetMap(), (DynamicObject*)NULL);
|
||||
return GetObjectInMap(guid, u.GetMap(), (DynamicObject*)nullptr);
|
||||
}
|
||||
|
||||
Unit* ObjectAccessor::GetUnit(WorldObject const& u, uint64 guid)
|
||||
{
|
||||
return GetObjectInMap(guid, u.GetMap(), (Unit*)NULL);
|
||||
return GetObjectInMap(guid, u.GetMap(), (Unit*)nullptr);
|
||||
}
|
||||
|
||||
Creature* ObjectAccessor::GetCreature(WorldObject const& u, uint64 guid)
|
||||
{
|
||||
return GetObjectInMap(guid, u.GetMap(), (Creature*)NULL);
|
||||
return GetObjectInMap(guid, u.GetMap(), (Creature*)nullptr);
|
||||
}
|
||||
|
||||
Pet* ObjectAccessor::GetPet(WorldObject const& u, uint64 guid)
|
||||
{
|
||||
return GetObjectInMap(guid, u.GetMap(), (Pet*)NULL);
|
||||
return GetObjectInMap(guid, u.GetMap(), (Pet*)nullptr);
|
||||
}
|
||||
|
||||
Player* ObjectAccessor::GetPlayer(WorldObject const& u, uint64 guid)
|
||||
{
|
||||
return GetObjectInMap(guid, u.GetMap(), (Player*)NULL);
|
||||
return GetObjectInMap(guid, u.GetMap(), (Player*)nullptr);
|
||||
}
|
||||
|
||||
Creature* ObjectAccessor::GetCreatureOrPetOrVehicle(WorldObject const& u, uint64 guid)
|
||||
|
|
@ -165,22 +165,22 @@ Creature* ObjectAccessor::GetCreatureOrPetOrVehicle(WorldObject const& u, uint64
|
|||
|
||||
Pet* ObjectAccessor::FindPet(uint64 guid)
|
||||
{
|
||||
return GetObjectInWorld(guid, (Pet*)NULL);
|
||||
return GetObjectInWorld(guid, (Pet*)nullptr);
|
||||
}
|
||||
|
||||
Player* ObjectAccessor::FindPlayer(uint64 guid)
|
||||
{
|
||||
return GetObjectInWorld(guid, (Player*)NULL);
|
||||
return GetObjectInWorld(guid, (Player*)nullptr);
|
||||
}
|
||||
|
||||
Player* ObjectAccessor::FindPlayerInOrOutOfWorld(uint64 guid)
|
||||
{
|
||||
return GetObjectInOrOutOfWorld(guid, (Player*)NULL);
|
||||
return GetObjectInOrOutOfWorld(guid, (Player*)nullptr);
|
||||
}
|
||||
|
||||
Unit* ObjectAccessor::FindUnit(uint64 guid)
|
||||
{
|
||||
return GetObjectInWorld(guid, (Unit*)NULL);
|
||||
return GetObjectInWorld(guid, (Unit*)nullptr);
|
||||
}
|
||||
|
||||
Player* ObjectAccessor::FindConnectedPlayer(uint64 const& guid)
|
||||
|
|
@ -334,7 +334,7 @@ Corpse* ObjectAccessor::ConvertCorpseForPlayer(uint64 player_guid, bool insignia
|
|||
sLog->outStaticDebug("Deleting Corpse and spawned bones.");
|
||||
#endif
|
||||
|
||||
// Map can be NULL
|
||||
// Map can be nullptr
|
||||
Map* map = corpse->FindMap();
|
||||
bool inWorld = corpse->IsInWorld();
|
||||
|
||||
|
|
@ -419,7 +419,7 @@ void ObjectAccessor::RemoveOldCorpses()
|
|||
next2 = itr;
|
||||
++next2;
|
||||
|
||||
Corpse* c = GetObjectInWorld((*itr), (Corpse*)NULL);
|
||||
Corpse* c = GetObjectInWorld((*itr), (Corpse*)nullptr);
|
||||
if (c)
|
||||
{
|
||||
if (!c->IsExpired(now))
|
||||
|
|
|
|||
|
|
@ -134,7 +134,7 @@ public:
|
|||
template<class T> static T* GetObjectInMap(uint64 guid, Map* map, T* /*typeSpecifier*/)
|
||||
{
|
||||
ASSERT(map);
|
||||
if (T* obj = GetObjectInWorld(guid, (T*)NULL))
|
||||
if (T* obj = GetObjectInWorld(guid, (T*)nullptr))
|
||||
if (obj->GetMap() == map)
|
||||
return obj;
|
||||
return nullptr;
|
||||
|
|
|
|||
|
|
@ -1278,7 +1278,7 @@ CreatureModelInfo const* ObjectMgr::GetCreatureModelInfo(uint32 modelId)
|
|||
return nullptr;
|
||||
}
|
||||
|
||||
uint32 ObjectMgr::ChooseDisplayId(CreatureTemplate const* cinfo, CreatureData const* data /*= NULL*/)
|
||||
uint32 ObjectMgr::ChooseDisplayId(CreatureTemplate const* cinfo, CreatureData const* data /*= nullptr*/)
|
||||
{
|
||||
// Load creature model (display id)
|
||||
if (data && data->displayid)
|
||||
|
|
@ -1287,7 +1287,7 @@ uint32 ObjectMgr::ChooseDisplayId(CreatureTemplate const* cinfo, CreatureData co
|
|||
return cinfo->GetRandomValidModelId();
|
||||
}
|
||||
|
||||
void ObjectMgr::ChooseCreatureFlags(const CreatureTemplate* cinfo, uint32& npcflag, uint32& unit_flags, uint32& dynamicflags, const CreatureData* data /*= NULL*/)
|
||||
void ObjectMgr::ChooseCreatureFlags(const CreatureTemplate* cinfo, uint32& npcflag, uint32& unit_flags, uint32& dynamicflags, const CreatureData* data /*= nullptr*/)
|
||||
{
|
||||
npcflag = cinfo->npcflag;
|
||||
unit_flags = cinfo->unit_flags;
|
||||
|
|
@ -8042,7 +8042,7 @@ GameTele const* ObjectMgr::GetGameTele(const std::string& name) const
|
|||
{
|
||||
if (itr->second.wnameLow == wname)
|
||||
return &itr->second;
|
||||
else if (alt == NULL && itr->second.wnameLow.find(wname) != std::wstring::npos)
|
||||
else if (alt == nullptr && itr->second.wnameLow.find(wname) != std::wstring::npos)
|
||||
alt = &itr->second;
|
||||
}
|
||||
|
||||
|
|
@ -8314,7 +8314,7 @@ int ObjectMgr::LoadReferenceVendor(int32 vendor, int32 item, std::set<uint32>* s
|
|||
uint32 incrtime = fields[2].GetUInt32();
|
||||
uint32 ExtendedCost = fields[3].GetUInt32();
|
||||
|
||||
if (!IsVendorItemValid(vendor, item_id, maxcount, incrtime, ExtendedCost, NULL, skip_vendors))
|
||||
if (!IsVendorItemValid(vendor, item_id, maxcount, incrtime, ExtendedCost, nullptr, skip_vendors))
|
||||
continue;
|
||||
|
||||
VendorItemData& vList = _cacheVendorItemStore[vendor];
|
||||
|
|
@ -8364,7 +8364,7 @@ void ObjectMgr::LoadVendors()
|
|||
uint32 incrtime = fields[3].GetUInt32();
|
||||
uint32 ExtendedCost = fields[4].GetUInt32();
|
||||
|
||||
if (!IsVendorItemValid(entry, item_id, maxcount, incrtime, ExtendedCost, NULL, &skip_vendors))
|
||||
if (!IsVendorItemValid(entry, item_id, maxcount, incrtime, ExtendedCost, nullptr, &skip_vendors))
|
||||
continue;
|
||||
|
||||
VendorItemData& vList = _cacheVendorItemStore[entry];
|
||||
|
|
|
|||
|
|
@ -497,7 +497,7 @@ bool Group::AddMember(Player* player)
|
|||
return true;
|
||||
}
|
||||
|
||||
bool Group::RemoveMember(uint64 guid, const RemoveMethod& method /*= GROUP_REMOVEMETHOD_DEFAULT*/, uint64 kicker /*= 0*/, const char* reason /*= NULL*/)
|
||||
bool Group::RemoveMember(uint64 guid, const RemoveMethod& method /*= GROUP_REMOVEMETHOD_DEFAULT*/, uint64 kicker /*= 0*/, const char* reason /*= nullptr*/)
|
||||
{
|
||||
BroadcastGroupUpdate();
|
||||
|
||||
|
|
@ -1355,7 +1355,7 @@ void Group::CountTheRoll(Rolls::iterator rollI, Map* allowedMap)
|
|||
continue;
|
||||
|
||||
player = ObjectAccessor::FindPlayer(itr->first);
|
||||
if (!player || (allowedMap != NULL && player->FindMap() != allowedMap))
|
||||
if (!player || (allowedMap != nullptr && player->FindMap() != allowedMap))
|
||||
{
|
||||
--roll->totalNeed;
|
||||
continue;
|
||||
|
|
@ -1419,7 +1419,7 @@ void Group::CountTheRoll(Rolls::iterator rollI, Map* allowedMap)
|
|||
continue;
|
||||
|
||||
player = ObjectAccessor::FindPlayer(itr->first);
|
||||
if (!player || (allowedMap != NULL && player->FindMap() != allowedMap))
|
||||
if (!player || (allowedMap != nullptr && player->FindMap() != allowedMap))
|
||||
{
|
||||
--roll->totalGreed;
|
||||
continue;
|
||||
|
|
|
|||
|
|
@ -95,7 +95,7 @@ enum GroupUpdateFlags
|
|||
GROUP_UPDATE_FLAG_POSITION = 0x00000100, // uint16, uint16
|
||||
GROUP_UPDATE_FLAG_AURAS = 0x00000200, // uint64 mask, for each bit set uint32 spellid + uint8 unk
|
||||
GROUP_UPDATE_FLAG_PET_GUID = 0x00000400, // uint64 pet guid
|
||||
GROUP_UPDATE_FLAG_PET_NAME = 0x00000800, // pet name, NULL terminated string
|
||||
GROUP_UPDATE_FLAG_PET_NAME = 0x00000800, // pet name, nullptr terminated string
|
||||
GROUP_UPDATE_FLAG_PET_MODEL_ID = 0x00001000, // uint16, model id
|
||||
GROUP_UPDATE_FLAG_PET_CUR_HP = 0x00002000, // uint32 pet cur health
|
||||
GROUP_UPDATE_FLAG_PET_MAX_HP = 0x00004000, // uint32 pet max health
|
||||
|
|
|
|||
|
|
@ -531,7 +531,7 @@ void Guild::BankTab::SetText(std::string const& text)
|
|||
}
|
||||
|
||||
// Sets/removes contents of specified slot.
|
||||
// If pItem == NULL contents are removed.
|
||||
// If pItem == nullptr contents are removed.
|
||||
bool Guild::BankTab::SetItem(SQLTransaction& trans, uint8 slotId, Item* item)
|
||||
{
|
||||
if (slotId >= GUILD_BANK_MAX_SLOTS)
|
||||
|
|
@ -2155,7 +2155,7 @@ void Guild::BroadcastToGuild(WorldSession* session, bool officerOnly, std::strin
|
|||
if (session && session->GetPlayer() && _HasRankRight(session->GetPlayer(), officerOnly ? GR_RIGHT_OFFCHATSPEAK : GR_RIGHT_GCHATSPEAK))
|
||||
{
|
||||
WorldPacket data;
|
||||
ChatHandler::BuildChatPacket(data, officerOnly ? CHAT_MSG_OFFICER : CHAT_MSG_GUILD, Language(language), session->GetPlayer(), NULL, msg);
|
||||
ChatHandler::BuildChatPacket(data, officerOnly ? CHAT_MSG_OFFICER : CHAT_MSG_GUILD, Language(language), session->GetPlayer(), nullptr, msg);
|
||||
for (Members::const_iterator itr = m_members.begin(); itr != m_members.end(); ++itr)
|
||||
if (Player* player = itr->second->FindPlayer())
|
||||
if (_HasRankRight(player, officerOnly ? GR_RIGHT_OFFCHATLISTEN : GR_RIGHT_GCHATLISTEN) && !player->GetSocial()->HasIgnore(session->GetPlayer()->GetGUIDLow()))
|
||||
|
|
@ -2873,7 +2873,7 @@ void Guild::_BroadcastEvent(GuildEvents guildEvent, uint64 guid, const char* par
|
|||
#endif
|
||||
}
|
||||
|
||||
void Guild::_SendBankList(WorldSession* session /* = NULL*/, uint8 tabId /*= 0*/, bool sendAllSlots /*= false*/, SlotIds* slots /*= NULL*/) const
|
||||
void Guild::_SendBankList(WorldSession* session /* = nullptr*/, uint8 tabId /*= 0*/, bool sendAllSlots /*= false*/, SlotIds* slots /*= nullptr*/) const
|
||||
{
|
||||
WorldPacket data(SMSG_GUILD_BANK_LIST, 500);
|
||||
data << uint64(m_bankMoney);
|
||||
|
|
|
|||
|
|
@ -330,7 +330,7 @@ public: // pussywizard: public class Member
|
|||
int32 GetBankWithdrawValue(uint8 tabId) const;
|
||||
void ResetValues();
|
||||
|
||||
inline Player* FindPlayer() const { return ObjectAccessor::GetObjectInOrOutOfWorld(m_guid, (Player*)NULL); }
|
||||
inline Player* FindPlayer() const { return ObjectAccessor::GetObjectInOrOutOfWorld(m_guid, (Player*)nullptr); }
|
||||
|
||||
private:
|
||||
uint32 m_guildId;
|
||||
|
|
@ -841,8 +841,8 @@ private:
|
|||
void _SendBankMoneyUpdate(WorldSession* session) const;
|
||||
void _SendBankContentUpdate(MoveItemData* pSrc, MoveItemData* pDest) const;
|
||||
void _SendBankContentUpdate(uint8 tabId, SlotIds slots) const;
|
||||
void _SendBankList(WorldSession* session = NULL, uint8 tabId = 0, bool sendFullSlots = false, SlotIds* slots = nullptr) const;
|
||||
void _SendBankList(WorldSession* session = nullptr, uint8 tabId = 0, bool sendFullSlots = false, SlotIds* slots = nullptr) const;
|
||||
|
||||
void _BroadcastEvent(GuildEvents guildEvent, uint64 guid, const char* param1 = NULL, const char* param2 = NULL, const char* param3 = nullptr) const;
|
||||
void _BroadcastEvent(GuildEvents guildEvent, uint64 guid, const char* param1 = nullptr, const char* param2 = nullptr, const char* param3 = nullptr) const;
|
||||
};
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -564,7 +564,7 @@ void WorldSession::HandleAuctionRemoveItem(WorldPacket& recvData)
|
|||
{
|
||||
SendAuctionCommandResult(0, AUCTION_CANCEL, ERR_AUCTION_DATABASE_ERROR);
|
||||
//this code isn't possible ... maybe there should be assert
|
||||
sLog->outError("CHEATER : %u, he tried to cancel auction (id: %u) of another player, or auction is NULL", player->GetGUIDLow(), auctionId);
|
||||
sLog->outError("CHEATER : %u, he tried to cancel auction (id: %u) of another player, or auction is nullptr", player->GetGUIDLow(), auctionId);
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -171,7 +171,7 @@ void WorldSession::HandleBattlemasterJoinOpcode(WorldPacket& recvData)
|
|||
}
|
||||
|
||||
BattlegroundQueue& bgQueue = sBattlegroundMgr->GetBattlegroundQueue(bgQueueTypeId);
|
||||
GroupQueueInfo* ginfo = bgQueue.AddGroup(_player, NULL, bracketEntry, false, false, 0, 0, 0);
|
||||
GroupQueueInfo* ginfo = bgQueue.AddGroup(_player, nullptr, bracketEntry, false, false, 0, 0, 0);
|
||||
uint32 avgWaitTime = bgQueue.GetAverageQueueWaitTime(ginfo);
|
||||
|
||||
uint32 queueSlot = _player->AddBattlegroundQueueId(bgQueueTypeId);
|
||||
|
|
@ -675,7 +675,7 @@ void WorldSession::HandleBattlemasterJoinArena(WorldPacket& recvData)
|
|||
}
|
||||
|
||||
BattlegroundQueue& bgQueue = sBattlegroundMgr->GetBattlegroundQueue(bgQueueTypeId);
|
||||
GroupQueueInfo* ginfo = bgQueue.AddGroup(_player, NULL, bracketEntry, false, false, 0, 0, 0);
|
||||
GroupQueueInfo* ginfo = bgQueue.AddGroup(_player, nullptr, bracketEntry, false, false, 0, 0, 0);
|
||||
uint32 avgWaitTime = bgQueue.GetAverageQueueWaitTime(ginfo);
|
||||
|
||||
uint32 queueSlot = _player->AddBattlegroundQueueId(bgQueueTypeId);
|
||||
|
|
|
|||
|
|
@ -340,7 +340,7 @@ void WorldSession::HandleSetChannelWatch(WorldPacket& recvPacket)
|
|||
return;
|
||||
|
||||
if (ChannelMgr* cMgr = ChannelMgr::forTeam(GetPlayer()->GetTeamId()))
|
||||
if (Channel* channel = cMgr->GetChannel(channelName, NULL, false))
|
||||
if (Channel* channel = cMgr->GetChannel(channelName, nullptr, false))
|
||||
channel->AddWatching(GetPlayer());
|
||||
}
|
||||
|
||||
|
|
@ -353,6 +353,6 @@ void WorldSession::HandleClearChannelWatch(WorldPacket& recvPacket)
|
|||
return;
|
||||
|
||||
if (ChannelMgr* cMgr = ChannelMgr::forTeam(GetPlayer()->GetTeamId()))
|
||||
if (Channel* channel = cMgr->GetChannel(channelName, NULL, false))
|
||||
if (Channel* channel = cMgr->GetChannel(channelName, nullptr, false))
|
||||
channel->RemoveWatching(GetPlayer());
|
||||
}
|
||||
|
|
|
|||
|
|
@ -115,7 +115,7 @@ bool LoginQueryHolder::Initialize()
|
|||
|
||||
stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_CHARACTER_MAILCOUNT_UNREAD);
|
||||
stmt->setUInt32(0, lowGuid);
|
||||
stmt->setUInt64(1, uint64(time(NULL)));
|
||||
stmt->setUInt64(1, uint64(time(nullptr)));
|
||||
res &= SetPreparedQuery(PLAYER_LOGIN_QUERY_LOAD_MAIL_UNREAD_COUNT, stmt);
|
||||
|
||||
stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_CHARACTER_MAILDATE);
|
||||
|
|
|
|||
|
|
@ -433,7 +433,7 @@ void WorldSession::HandleMessagechatOpcode(WorldPacket& recvData)
|
|||
return;
|
||||
#endif
|
||||
WorldPacket data;
|
||||
ChatHandler::BuildChatPacket(data, ChatMsg(type), Language(lang), sender, NULL, msg);
|
||||
ChatHandler::BuildChatPacket(data, ChatMsg(type), Language(lang), sender, nullptr, msg);
|
||||
group->BroadcastPacket(&data, false, group->GetMemberGroup(GetPlayer()->GetGUID()));
|
||||
}
|
||||
break;
|
||||
|
|
@ -488,7 +488,7 @@ void WorldSession::HandleMessagechatOpcode(WorldPacket& recvData)
|
|||
return;
|
||||
#endif
|
||||
WorldPacket data;
|
||||
ChatHandler::BuildChatPacket(data, CHAT_MSG_RAID, Language(lang), sender, NULL, msg);
|
||||
ChatHandler::BuildChatPacket(data, CHAT_MSG_RAID, Language(lang), sender, nullptr, msg);
|
||||
group->BroadcastPacket(&data, false);
|
||||
}
|
||||
break;
|
||||
|
|
@ -509,7 +509,7 @@ void WorldSession::HandleMessagechatOpcode(WorldPacket& recvData)
|
|||
return;
|
||||
#endif
|
||||
WorldPacket data;
|
||||
ChatHandler::BuildChatPacket(data, CHAT_MSG_RAID_LEADER, Language(lang), sender, NULL, msg);
|
||||
ChatHandler::BuildChatPacket(data, CHAT_MSG_RAID_LEADER, Language(lang), sender, nullptr, msg);
|
||||
group->BroadcastPacket(&data, false);
|
||||
}
|
||||
break;
|
||||
|
|
@ -526,7 +526,7 @@ void WorldSession::HandleMessagechatOpcode(WorldPacket& recvData)
|
|||
#endif
|
||||
WorldPacket data;
|
||||
//in battleground, raid warning is sent only to players in battleground - code is ok
|
||||
ChatHandler::BuildChatPacket(data, CHAT_MSG_RAID_WARNING, Language(lang), sender, NULL, msg);
|
||||
ChatHandler::BuildChatPacket(data, CHAT_MSG_RAID_WARNING, Language(lang), sender, nullptr, msg);
|
||||
group->BroadcastPacket(&data, false);
|
||||
}
|
||||
break;
|
||||
|
|
@ -543,7 +543,7 @@ void WorldSession::HandleMessagechatOpcode(WorldPacket& recvData)
|
|||
return;
|
||||
#endif
|
||||
WorldPacket data;
|
||||
ChatHandler::BuildChatPacket(data, CHAT_MSG_BATTLEGROUND, Language(lang), sender, NULL, msg);
|
||||
ChatHandler::BuildChatPacket(data, CHAT_MSG_BATTLEGROUND, Language(lang), sender, nullptr, msg);
|
||||
group->BroadcastPacket(&data, false);
|
||||
}
|
||||
break;
|
||||
|
|
@ -560,7 +560,7 @@ void WorldSession::HandleMessagechatOpcode(WorldPacket& recvData)
|
|||
return;
|
||||
#endif
|
||||
WorldPacket data;
|
||||
ChatHandler::BuildChatPacket(data, CHAT_MSG_BATTLEGROUND_LEADER, Language(lang), sender, NULL, msg);
|
||||
ChatHandler::BuildChatPacket(data, CHAT_MSG_BATTLEGROUND_LEADER, Language(lang), sender, nullptr, msg);
|
||||
group->BroadcastPacket(&data, false);
|
||||
}
|
||||
break;
|
||||
|
|
|
|||
|
|
@ -36,13 +36,13 @@ void WorldSession::HandleSplitItemOpcode(WorldPacket& recvData)
|
|||
|
||||
if (!_player->IsValidPos(srcbag, srcslot, true))
|
||||
{
|
||||
_player->SendEquipError(EQUIP_ERR_ITEM_NOT_FOUND, NULL, nullptr);
|
||||
_player->SendEquipError(EQUIP_ERR_ITEM_NOT_FOUND, nullptr, nullptr);
|
||||
return;
|
||||
}
|
||||
|
||||
if (!_player->IsValidPos(dstbag, dstslot, false)) // can be autostore pos
|
||||
{
|
||||
_player->SendEquipError(EQUIP_ERR_ITEM_DOESNT_GO_TO_SLOT, NULL, nullptr);
|
||||
_player->SendEquipError(EQUIP_ERR_ITEM_DOESNT_GO_TO_SLOT, nullptr, nullptr);
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
@ -63,13 +63,13 @@ void WorldSession::HandleSwapInvItemOpcode(WorldPacket& recvData)
|
|||
|
||||
if (!_player->IsValidPos(INVENTORY_SLOT_BAG_0, srcslot, true))
|
||||
{
|
||||
_player->SendEquipError(EQUIP_ERR_ITEM_NOT_FOUND, NULL, nullptr);
|
||||
_player->SendEquipError(EQUIP_ERR_ITEM_NOT_FOUND, nullptr, nullptr);
|
||||
return;
|
||||
}
|
||||
|
||||
if (!_player->IsValidPos(INVENTORY_SLOT_BAG_0, dstslot, true))
|
||||
{
|
||||
_player->SendEquipError(EQUIP_ERR_ITEM_DOESNT_GO_TO_SLOT, NULL, nullptr);
|
||||
_player->SendEquipError(EQUIP_ERR_ITEM_DOESNT_GO_TO_SLOT, nullptr, nullptr);
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
@ -127,13 +127,13 @@ void WorldSession::HandleSwapItem(WorldPacket& recvData)
|
|||
|
||||
if (!_player->IsValidPos(srcbag, srcslot, true))
|
||||
{
|
||||
_player->SendEquipError(EQUIP_ERR_ITEM_NOT_FOUND, NULL, nullptr);
|
||||
_player->SendEquipError(EQUIP_ERR_ITEM_NOT_FOUND, nullptr, nullptr);
|
||||
return;
|
||||
}
|
||||
|
||||
if (!_player->IsValidPos(dstbag, dstslot, true))
|
||||
{
|
||||
_player->SendEquipError(EQUIP_ERR_ITEM_DOESNT_GO_TO_SLOT, NULL, nullptr);
|
||||
_player->SendEquipError(EQUIP_ERR_ITEM_DOESNT_GO_TO_SLOT, nullptr, nullptr);
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
@ -245,7 +245,7 @@ void WorldSession::HandleAutoEquipItemOpcode(WorldPacket& recvData)
|
|||
_player->AutoUnequipOffhandIfNeed();
|
||||
|
||||
// Xinef: Call this here after all needed items are equipped
|
||||
_player->RemoveItemDependentAurasAndCasts((Item*)NULL);
|
||||
_player->RemoveItemDependentAurasAndCasts((Item*)nullptr);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -273,13 +273,13 @@ void WorldSession::HandleDestroyItemOpcode(WorldPacket& recvData)
|
|||
Item* pItem = _player->GetItemByPos(bag, slot);
|
||||
if (!pItem)
|
||||
{
|
||||
_player->SendEquipError(EQUIP_ERR_ITEM_NOT_FOUND, NULL, nullptr);
|
||||
_player->SendEquipError(EQUIP_ERR_ITEM_NOT_FOUND, nullptr, nullptr);
|
||||
return;
|
||||
}
|
||||
|
||||
if (pItem->GetTemplate()->Flags & ITEM_FLAG_NO_USER_DESTROY)
|
||||
{
|
||||
_player->SendEquipError(EQUIP_ERR_CANT_DROP_SOULBOUND, NULL, nullptr);
|
||||
_player->SendEquipError(EQUIP_ERR_CANT_DROP_SOULBOUND, nullptr, nullptr);
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
@ -621,7 +621,7 @@ void WorldSession::HandleReadItem(WorldPacket& recvData)
|
|||
SendPacket(&data);
|
||||
}
|
||||
else
|
||||
_player->SendEquipError(EQUIP_ERR_ITEM_NOT_FOUND, NULL, nullptr);
|
||||
_player->SendEquipError(EQUIP_ERR_ITEM_NOT_FOUND, nullptr, nullptr);
|
||||
}
|
||||
|
||||
void WorldSession::HandleSellItemOpcode(WorldPacket& recvData)
|
||||
|
|
@ -643,7 +643,7 @@ void WorldSession::HandleSellItemOpcode(WorldPacket& recvData)
|
|||
#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS)
|
||||
sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: HandleSellItemOpcode - Unit (GUID: %u) not found or you can not interact with him.", uint32(GUID_LOPART(vendorguid)));
|
||||
#endif
|
||||
_player->SendSellError(SELL_ERR_CANT_FIND_VENDOR, NULL, itemguid, 0);
|
||||
_player->SendSellError(SELL_ERR_CANT_FIND_VENDOR, nullptr, itemguid, 0);
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
@ -768,7 +768,7 @@ void WorldSession::HandleBuybackItem(WorldPacket& recvData)
|
|||
#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS)
|
||||
sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: HandleBuybackItem - Unit (GUID: %u) not found or you can not interact with him.", uint32(GUID_LOPART(vendorguid)));
|
||||
#endif
|
||||
_player->SendSellError(SELL_ERR_CANT_FIND_VENDOR, NULL, 0, 0);
|
||||
_player->SendSellError(SELL_ERR_CANT_FIND_VENDOR, nullptr, 0, 0);
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
@ -905,7 +905,7 @@ void WorldSession::SendListInventory(uint64 vendorGuid, uint32 vendorEntry)
|
|||
#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS)
|
||||
sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: SendListInventory - Unit (GUID: %u) not found or you can not interact with him.", uint32(GUID_LOPART(vendorGuid)));
|
||||
#endif
|
||||
_player->SendSellError(SELL_ERR_CANT_FIND_VENDOR, NULL, 0, 0);
|
||||
_player->SendSellError(SELL_ERR_CANT_FIND_VENDOR, nullptr, 0, 0);
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
@ -1011,7 +1011,7 @@ void WorldSession::HandleAutoStoreBagItemOpcode(WorldPacket& recvData)
|
|||
|
||||
if (!_player->IsValidPos(dstbag, NULL_SLOT, false)) // can be autostore pos
|
||||
{
|
||||
_player->SendEquipError(EQUIP_ERR_ITEM_DOESNT_GO_TO_SLOT, NULL, nullptr);
|
||||
_player->SendEquipError(EQUIP_ERR_ITEM_DOESNT_GO_TO_SLOT, nullptr, nullptr);
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
@ -1200,7 +1200,7 @@ void WorldSession::HandleSetAmmoOpcode(WorldPacket& recvData)
|
|||
{
|
||||
if (!_player->IsAlive())
|
||||
{
|
||||
_player->SendEquipError(EQUIP_ERR_YOU_ARE_DEAD, NULL, nullptr);
|
||||
_player->SendEquipError(EQUIP_ERR_YOU_ARE_DEAD, nullptr, nullptr);
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
@ -1215,7 +1215,7 @@ void WorldSession::HandleSetAmmoOpcode(WorldPacket& recvData)
|
|||
{
|
||||
if (!_player->GetItemCount(item))
|
||||
{
|
||||
_player->SendEquipError(EQUIP_ERR_ITEM_NOT_FOUND, NULL, nullptr);
|
||||
_player->SendEquipError(EQUIP_ERR_ITEM_NOT_FOUND, nullptr, nullptr);
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -92,7 +92,7 @@ uint8 WorldSession::HandleLoadPetFromDBFirstCallback(PreparedQueryResult result,
|
|||
uint8 petSlot = fields[7].GetUInt8();
|
||||
bool current = petSlot == PET_SAVE_AS_CURRENT;
|
||||
uint32 summon_spell_id = fields[15].GetUInt32();
|
||||
SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(summon_spell_id); // CANT BE NULL
|
||||
SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(summon_spell_id); // CANT BE nullptr
|
||||
bool is_temporary_summoned = spellInfo && spellInfo->GetDuration() > 0;
|
||||
uint32 pet_number = fields[0].GetUInt32();
|
||||
uint32 savedhealth = fields[10].GetUInt32();
|
||||
|
|
@ -293,7 +293,7 @@ void WorldSession::HandleLoadPetFromDBSecondCallback(LoadPetFromDBQueryHolder* h
|
|||
pet->_LoadAuras(holder->GetPreparedResult(PET_LOAD_QUERY_LOADAURAS), holder->GetDiffTime());
|
||||
bool current = holder->GetCurrent();
|
||||
uint32 summon_spell_id = pet->GetUInt32Value(UNIT_CREATED_BY_SPELL);
|
||||
SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(summon_spell_id); // CANT BE NULL
|
||||
SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(summon_spell_id); // CANT BE nullptr
|
||||
bool is_temporary_summoned = spellInfo && spellInfo->GetDuration() > 0;
|
||||
|
||||
// load action bar, if data broken will fill later by default spells.
|
||||
|
|
@ -835,7 +835,7 @@ void WorldSession::HandlePetActionHelper(Unit* pet, uint64 guid1, uint16 spellid
|
|||
pet->SendPetAIReaction(guid1);
|
||||
}
|
||||
|
||||
pet->ToPet()->CastWhenWillAvailable(spellid, unit_target, NULL, tempspellIsPositive);
|
||||
pet->ToPet()->CastWhenWillAvailable(spellid, unit_target, nullptr, tempspellIsPositive);
|
||||
}
|
||||
}
|
||||
else if (haspositiveeffect)
|
||||
|
|
|
|||
|
|
@ -167,7 +167,7 @@ void WorldSession::HandlePetitionBuyOpcode(WorldPacket& recvData)
|
|||
ItemTemplate const* pProto = sObjectMgr->GetItemTemplate(charterid);
|
||||
if (!pProto)
|
||||
{
|
||||
_player->SendBuyError(BUY_ERR_CANT_FIND_ITEM, NULL, charterid, 0);
|
||||
_player->SendBuyError(BUY_ERR_CANT_FIND_ITEM, nullptr, charterid, 0);
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -479,7 +479,7 @@ void WorldSession::HandleQuestConfirmAccept(WorldPacket& recvData)
|
|||
return;
|
||||
|
||||
if (_player->CanAddQuest(quest, true))
|
||||
_player->AddQuestAndCheckCompletion(quest, nullptr); // NULL, this prevent DB script from duplicate running
|
||||
_player->AddQuestAndCheckCompletion(quest, nullptr); // nullptr, this prevent DB script from duplicate running
|
||||
|
||||
_player->SetDivider(0);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -69,20 +69,20 @@ void WorldSession::HandleUseItemOpcode(WorldPacket& recvPacket)
|
|||
|
||||
if (glyphIndex >= MAX_GLYPH_SLOT_INDEX)
|
||||
{
|
||||
pUser->SendEquipError(EQUIP_ERR_ITEM_NOT_FOUND, NULL, nullptr);
|
||||
pUser->SendEquipError(EQUIP_ERR_ITEM_NOT_FOUND, nullptr, nullptr);
|
||||
return;
|
||||
}
|
||||
|
||||
Item* pItem = pUser->GetUseableItemByPos(bagIndex, slot);
|
||||
if (!pItem)
|
||||
{
|
||||
pUser->SendEquipError(EQUIP_ERR_ITEM_NOT_FOUND, NULL, nullptr);
|
||||
pUser->SendEquipError(EQUIP_ERR_ITEM_NOT_FOUND, nullptr, nullptr);
|
||||
return;
|
||||
}
|
||||
|
||||
if (pItem->GetGUID() != itemGUID)
|
||||
{
|
||||
pUser->SendEquipError(EQUIP_ERR_ITEM_NOT_FOUND, NULL, nullptr);
|
||||
pUser->SendEquipError(EQUIP_ERR_ITEM_NOT_FOUND, nullptr, nullptr);
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
@ -177,7 +177,7 @@ void WorldSession::HandleOpenItemOpcode(WorldPacket& recvPacket)
|
|||
// xinef: additional check, client outputs message on its own
|
||||
if (!pUser->IsAlive())
|
||||
{
|
||||
pUser->SendEquipError(EQUIP_ERR_YOU_ARE_DEAD, NULL, nullptr);
|
||||
pUser->SendEquipError(EQUIP_ERR_YOU_ARE_DEAD, nullptr, nullptr);
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
@ -192,7 +192,7 @@ void WorldSession::HandleOpenItemOpcode(WorldPacket& recvPacket)
|
|||
Item* item = pUser->GetItemByPos(bagIndex, slot);
|
||||
if (!item)
|
||||
{
|
||||
pUser->SendEquipError(EQUIP_ERR_ITEM_NOT_FOUND, NULL, nullptr);
|
||||
pUser->SendEquipError(EQUIP_ERR_ITEM_NOT_FOUND, nullptr, nullptr);
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
@ -437,7 +437,7 @@ void WorldSession::HandleCastSpellOpcode(WorldPacket& recvPacket)
|
|||
{
|
||||
SpellInfo const* actualSpellInfo = spellInfo->GetAuraRankForLevel(targets.GetUnitTarget()->getLevel());
|
||||
|
||||
// if rank not found then function return NULL but in explicit cast case original spell can be casted and later failed with appropriate error message
|
||||
// if rank not found then function return nullptr but in explicit cast case original spell can be casted and later failed with appropriate error message
|
||||
if (actualSpellInfo)
|
||||
spellInfo = actualSpellInfo;
|
||||
}
|
||||
|
|
@ -620,7 +620,7 @@ void WorldSession::HandleMirrorImageDataRequest(WorldPacket& recvData)
|
|||
recvData >> guid;
|
||||
|
||||
// Get unit for which data is needed by client
|
||||
Unit* unit = ObjectAccessor::GetObjectInWorld(guid, (Unit*)NULL);
|
||||
Unit* unit = ObjectAccessor::GetObjectInWorld(guid, (Unit*)nullptr);
|
||||
if (!unit)
|
||||
return;
|
||||
|
||||
|
|
|
|||
|
|
@ -133,8 +133,8 @@ void WorldSession::moveItems(Item* myItems[], Item* hisItems[])
|
|||
{
|
||||
ItemPosCountVec traderDst;
|
||||
ItemPosCountVec playerDst;
|
||||
bool traderCanTrade = (myItems[i] == NULL || trader->CanStoreItem(NULL_BAG, NULL_SLOT, traderDst, myItems[i], false) == EQUIP_ERR_OK);
|
||||
bool playerCanTrade = (hisItems[i] == NULL || _player->CanStoreItem(NULL_BAG, NULL_SLOT, playerDst, hisItems[i], false) == EQUIP_ERR_OK);
|
||||
bool traderCanTrade = (myItems[i] == nullptr || trader->CanStoreItem(NULL_BAG, NULL_SLOT, traderDst, myItems[i], false) == EQUIP_ERR_OK);
|
||||
bool playerCanTrade = (hisItems[i] == nullptr || _player->CanStoreItem(NULL_BAG, NULL_SLOT, playerDst, hisItems[i], false) == EQUIP_ERR_OK);
|
||||
if (traderCanTrade && playerCanTrade)
|
||||
{
|
||||
// Ok, if trade item exists and can be stored
|
||||
|
|
@ -209,7 +209,7 @@ static void setAcceptTradeMode(TradeData* myTrade, TradeData* hisTrade, Item * *
|
|||
#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS)
|
||||
sLog->outStaticDebug("player trade item %u bag: %u slot: %u", item->GetGUIDLow(), item->GetBagSlot(), item->GetSlot());
|
||||
#endif
|
||||
//Can return NULL
|
||||
//Can return nullptr
|
||||
myItems[i] = item;
|
||||
myItems[i]->SetInTrade();
|
||||
}
|
||||
|
|
@ -280,14 +280,14 @@ void WorldSession::HandleAcceptTradeOpcode(WorldPacket& /*recvPacket*/)
|
|||
|
||||
if (_player->GetMoney() >= uint32(MAX_MONEY_AMOUNT) - his_trade->GetMoney())
|
||||
{
|
||||
_player->SendEquipError(EQUIP_ERR_TOO_MUCH_GOLD, NULL, nullptr);
|
||||
_player->SendEquipError(EQUIP_ERR_TOO_MUCH_GOLD, nullptr, nullptr);
|
||||
my_trade->SetAccepted(false, true);
|
||||
return;
|
||||
}
|
||||
|
||||
if (trader->GetMoney() >= uint32(MAX_MONEY_AMOUNT) - my_trade->GetMoney())
|
||||
{
|
||||
trader->SendEquipError(EQUIP_ERR_TOO_MUCH_GOLD, NULL, nullptr);
|
||||
trader->SendEquipError(EQUIP_ERR_TOO_MUCH_GOLD, nullptr, nullptr);
|
||||
his_trade->SetAccepted(false, true);
|
||||
return;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -459,7 +459,7 @@ void InstanceSaveManager::_ResetSave(InstanceSaveHashMap::iterator& itr)
|
|||
for (InstanceSave::PlayerListType::iterator iter = pList.begin(), iter2; iter != pList.end(); )
|
||||
{
|
||||
iter2 = iter++;
|
||||
PlayerUnbindInstanceNotExtended(*iter2, itr->second->GetMapId(), itr->second->GetDifficulty(), ObjectAccessor::GetObjectInOrOutOfWorld(MAKE_NEW_GUID(*iter2, 0, HIGHGUID_PLAYER), (Player*)NULL));
|
||||
PlayerUnbindInstanceNotExtended(*iter2, itr->second->GetMapId(), itr->second->GetDifficulty(), ObjectAccessor::GetObjectInOrOutOfWorld(MAKE_NEW_GUID(*iter2, 0, HIGHGUID_PLAYER), (Player*)nullptr));
|
||||
}
|
||||
|
||||
// delete stuff if no players left (noone extended id)
|
||||
|
|
@ -576,7 +576,7 @@ void InstanceSaveManager::_ResetOrWarnAll(uint32 mapid, Difficulty difficulty, b
|
|||
}
|
||||
}
|
||||
|
||||
InstancePlayerBind* InstanceSaveManager::PlayerBindToInstance(uint32 guidLow, InstanceSave* save, bool permanent, Player* player /*= NULL*/)
|
||||
InstancePlayerBind* InstanceSaveManager::PlayerBindToInstance(uint32 guidLow, InstanceSave* save, bool permanent, Player* player /*= nullptr*/)
|
||||
{
|
||||
InstancePlayerBind& bind = playerBindStorage[guidLow]->m[save->GetDifficulty()][save->GetMapId()];
|
||||
ASSERT(!bind.perm || permanent); // ensure there's no changing permanent to temporary, this can be done only by unbinding
|
||||
|
|
@ -645,7 +645,7 @@ InstancePlayerBind* InstanceSaveManager::PlayerBindToInstance(uint32 guidLow, In
|
|||
return &bind;
|
||||
}
|
||||
|
||||
void InstanceSaveManager::PlayerUnbindInstance(uint32 guidLow, uint32 mapid, Difficulty difficulty, bool deleteFromDB, Player* player /*= NULL*/)
|
||||
void InstanceSaveManager::PlayerUnbindInstance(uint32 guidLow, uint32 mapid, Difficulty difficulty, bool deleteFromDB, Player* player /*= nullptr*/)
|
||||
{
|
||||
BoundInstancesMapWrapper* w = playerBindStorage[guidLow];
|
||||
BoundInstancesMap::iterator itr = w->m[difficulty].find(mapid);
|
||||
|
|
@ -668,7 +668,7 @@ void InstanceSaveManager::PlayerUnbindInstance(uint32 guidLow, uint32 mapid, Dif
|
|||
}
|
||||
}
|
||||
|
||||
void InstanceSaveManager::PlayerUnbindInstanceNotExtended(uint32 guidLow, uint32 mapid, Difficulty difficulty, Player* player /*= NULL*/)
|
||||
void InstanceSaveManager::PlayerUnbindInstanceNotExtended(uint32 guidLow, uint32 mapid, Difficulty difficulty, Player* player /*= nullptr*/)
|
||||
{
|
||||
BoundInstancesMapWrapper* w = playerBindStorage[guidLow];
|
||||
BoundInstancesMap::iterator itr = w->m[difficulty].find(mapid);
|
||||
|
|
@ -773,5 +773,5 @@ void InstanceSaveManager::UnbindAllFor(InstanceSave* save)
|
|||
{
|
||||
InstanceSave::PlayerListType& pList = save->m_playerList;
|
||||
while (!pList.empty())
|
||||
PlayerUnbindInstance(*(pList.begin()), save->GetMapId(), save->GetDifficulty(), true, ObjectAccessor::GetObjectInOrOutOfWorld(MAKE_NEW_GUID(*(pList.begin()), 0, HIGHGUID_PLAYER), (Player*)NULL));
|
||||
PlayerUnbindInstance(*(pList.begin()), save->GetMapId(), save->GetDifficulty(), true, ObjectAccessor::GetObjectInOrOutOfWorld(MAKE_NEW_GUID(*(pList.begin()), 0, HIGHGUID_PLAYER), (Player*)nullptr));
|
||||
}
|
||||
|
|
|
|||
|
|
@ -329,7 +329,7 @@ void InstanceScript::DoSendNotifyToInstance(char const* format, ...)
|
|||
}
|
||||
|
||||
// Update Achievement Criteria for all players in instance
|
||||
void InstanceScript::DoUpdateAchievementCriteria(AchievementCriteriaTypes type, uint32 miscValue1 /*= 0*/, uint32 miscValue2 /*= 0*/, Unit* unit /*= NULL*/)
|
||||
void InstanceScript::DoUpdateAchievementCriteria(AchievementCriteriaTypes type, uint32 miscValue1 /*= 0*/, uint32 miscValue2 /*= 0*/, Unit* unit /*= nullptr*/)
|
||||
{
|
||||
Map::PlayerList const& PlayerList = instance->GetPlayers();
|
||||
|
||||
|
|
@ -390,7 +390,7 @@ void InstanceScript::DoCastSpellOnPlayers(uint32 spell)
|
|||
player->CastSpell(player, spell, true);
|
||||
}
|
||||
|
||||
bool InstanceScript::CheckAchievementCriteriaMeet(uint32 criteria_id, Player const* /*source*/, Unit const* /*target*/ /*= NULL*/, uint32 /*miscvalue1*/ /*= 0*/)
|
||||
bool InstanceScript::CheckAchievementCriteriaMeet(uint32 criteria_id, Player const* /*source*/, Unit const* /*target*/ /*= nullptr*/, uint32 /*miscvalue1*/ /*= 0*/)
|
||||
{
|
||||
sLog->outError("Achievement system call InstanceScript::CheckAchievementCriteriaMeet but instance script for map %u not have implementation for achievement criteria %u",
|
||||
instance->GetId(), criteria_id);
|
||||
|
|
@ -416,7 +416,7 @@ void InstanceScript::SetCompletedEncountersMask(uint32 newMask, bool save)
|
|||
}
|
||||
}
|
||||
|
||||
void InstanceScript::SendEncounterUnit(uint32 type, Unit* unit /*= NULL*/, uint8 param1 /*= 0*/, uint8 param2 /*= 0*/)
|
||||
void InstanceScript::SendEncounterUnit(uint32 type, Unit* unit /*= nullptr*/, uint8 param1 /*= 0*/, uint8 param2 /*= 0*/)
|
||||
{
|
||||
// size of this packet is at most 15 (usually less)
|
||||
WorldPacket data(SMSG_UPDATE_INSTANCE_ENCOUNTER_UNIT, 15);
|
||||
|
|
|
|||
|
|
@ -193,7 +193,7 @@ public:
|
|||
|
||||
// Achievement criteria additional requirements check
|
||||
// NOTE: not use this if same can be checked existed requirement types from AchievementCriteriaRequirementType
|
||||
virtual bool CheckAchievementCriteriaMeet(uint32 /*criteria_id*/, Player const* /*source*/, Unit const* /*target*/ = NULL, uint32 /*miscvalue1*/ = 0);
|
||||
virtual bool CheckAchievementCriteriaMeet(uint32 /*criteria_id*/, Player const* /*source*/, Unit const* /*target*/ = nullptr, uint32 /*miscvalue1*/ = 0);
|
||||
|
||||
// Checks boss requirements (one boss required to kill other)
|
||||
virtual bool CheckRequiredBosses(uint32 /*bossId*/, Player const* /*player*/ = nullptr) const { return true; }
|
||||
|
|
@ -203,7 +203,7 @@ public:
|
|||
// Returns completed encounters mask for packets
|
||||
uint32 GetCompletedEncounterMask() const { return completedEncounters; }
|
||||
|
||||
void SendEncounterUnit(uint32 type, Unit* unit = NULL, uint8 param1 = 0, uint8 param2 = 0);
|
||||
void SendEncounterUnit(uint32 type, Unit* unit = nullptr, uint8 param1 = 0, uint8 param2 = 0);
|
||||
|
||||
virtual void FillInitialWorldStates(WorldPacket& /*data*/) {}
|
||||
|
||||
|
|
|
|||
|
|
@ -98,7 +98,7 @@ private:
|
|||
LootStoreItemList ExplicitlyChanced; // Entries with chances defined in DB
|
||||
LootStoreItemList EqualChanced; // Zero chances - every entry takes the same chance
|
||||
|
||||
LootStoreItem const* Roll(Loot& loot, Player const* player, LootStore const& store, uint16 lootMode) const; // Rolls an item from the group, returns NULL if all miss their chances
|
||||
LootStoreItem const* Roll(Loot& loot, Player const* player, LootStore const& store, uint16 lootMode) const; // Rolls an item from the group, returns nullptr if all miss their chances
|
||||
|
||||
// This class must never be copied - storing pointers
|
||||
LootGroup(LootGroup const&);
|
||||
|
|
@ -1119,7 +1119,7 @@ void LootTemplate::LootGroup::AddEntry(LootStoreItem* item)
|
|||
EqualChanced.push_back(item);
|
||||
}
|
||||
|
||||
// Rolls an item from the group, returns NULL if all miss their chances
|
||||
// Rolls an item from the group, returns nullptr if all miss their chances
|
||||
LootStoreItem const* LootTemplate::LootGroup::Roll(Loot& loot, Player const* player, LootStore const& store, uint16 lootMode) const
|
||||
{
|
||||
LootStoreItemList possibleLoot = ExplicitlyChanced;
|
||||
|
|
|
|||
|
|
@ -177,7 +177,7 @@ void MailDraft::SendMailTo(SQLTransaction& trans, MailReceiver const& receiver,
|
|||
if (!sendMail) // can be changed in the hook
|
||||
return;
|
||||
|
||||
Player* pReceiver = receiver.GetPlayer(); // can be NULL
|
||||
Player* pReceiver = receiver.GetPlayer(); // can be nullptr
|
||||
Player* pSender = ObjectAccessor::FindPlayerInOrOutOfWorld(MAKE_NEW_GUID(sender.GetSenderId(), 0, HIGHGUID_PLAYER));
|
||||
|
||||
if (pReceiver)
|
||||
|
|
|
|||
|
|
@ -185,11 +185,11 @@ void Map::LoadMap(int gx, int gy, bool reload)
|
|||
sScriptMgr->OnUnloadGridMap(this, GridMaps[gx][gy], gx, gy);
|
||||
|
||||
delete (GridMaps[gx][gy]);
|
||||
GridMaps[gx][gy] = NULL;
|
||||
GridMaps[gx][gy] = nullptr;
|
||||
}
|
||||
|
||||
// map file name
|
||||
char* tmp = NULL;
|
||||
char* tmp = nullptr;
|
||||
int len = sWorld->GetDataPath().length() + strlen("maps/%03u%02u%02u.map") + 1;
|
||||
tmp = new char[len];
|
||||
snprintf(tmp, len, (char*)(sWorld->GetDataPath() + "maps/%03u%02u%02u.map").c_str(), GetId(), gx, gy);
|
||||
|
|
@ -229,7 +229,7 @@ Map::Map(uint32 id, uint32 InstanceId, uint8 SpawnMode, Map* _parent) :
|
|||
for (unsigned int j = 0; j < MAX_NUMBER_OF_GRIDS; ++j)
|
||||
{
|
||||
//z code
|
||||
GridMaps[idx][j] = NULL;
|
||||
GridMaps[idx][j] = nullptr;
|
||||
setNGrid(nullptr, idx, j);
|
||||
}
|
||||
}
|
||||
|
|
@ -1909,7 +1909,7 @@ GridMap* Map::GetGrid(float x, float y)
|
|||
return GridMaps[gx][gy];
|
||||
}
|
||||
|
||||
float Map::GetWaterOrGroundLevel(uint32 phasemask, float x, float y, float z, float* ground /*= NULL*/, bool /*swim = false*/, float collisionHeight) const
|
||||
float Map::GetWaterOrGroundLevel(uint32 phasemask, float x, float y, float z, float* ground /*= nullptr*/, bool /*swim = false*/, float collisionHeight) const
|
||||
{
|
||||
if (const_cast<Map*>(this)->GetGrid(x, y))
|
||||
{
|
||||
|
|
@ -3056,17 +3056,17 @@ void BattlegroundMap::RemoveAllPlayers()
|
|||
|
||||
Player* Map::GetPlayer(uint64 guid)
|
||||
{
|
||||
return ObjectAccessor::GetObjectInMap(guid, this, (Player*)NULL);
|
||||
return ObjectAccessor::GetObjectInMap(guid, this, (Player*)nullptr);
|
||||
}
|
||||
|
||||
Creature* Map::GetCreature(uint64 guid)
|
||||
{
|
||||
return ObjectAccessor::GetObjectInMap(guid, this, (Creature*)NULL);
|
||||
return ObjectAccessor::GetObjectInMap(guid, this, (Creature*)nullptr);
|
||||
}
|
||||
|
||||
GameObject* Map::GetGameObject(uint64 guid)
|
||||
{
|
||||
return ObjectAccessor::GetObjectInMap(guid, this, (GameObject*)NULL);
|
||||
return ObjectAccessor::GetObjectInMap(guid, this, (GameObject*)nullptr);
|
||||
}
|
||||
|
||||
Transport* Map::GetTransport(uint64 guid)
|
||||
|
|
@ -3080,17 +3080,17 @@ Transport* Map::GetTransport(uint64 guid)
|
|||
|
||||
DynamicObject* Map::GetDynamicObject(uint64 guid)
|
||||
{
|
||||
return ObjectAccessor::GetObjectInMap(guid, this, (DynamicObject*)NULL);
|
||||
return ObjectAccessor::GetObjectInMap(guid, this, (DynamicObject*)nullptr);
|
||||
}
|
||||
|
||||
Pet* Map::GetPet(uint64 guid)
|
||||
{
|
||||
return ObjectAccessor::GetObjectInMap(guid, this, (Pet*)NULL);
|
||||
return ObjectAccessor::GetObjectInMap(guid, this, (Pet*)nullptr);
|
||||
}
|
||||
|
||||
Corpse* Map::GetCorpse(uint64 guid)
|
||||
{
|
||||
return ObjectAccessor::GetObjectInMap(guid, this, (Corpse*)NULL);
|
||||
return ObjectAccessor::GetObjectInMap(guid, this, (Corpse*)nullptr);
|
||||
}
|
||||
|
||||
void Map::UpdateIteratorBack(Player* player)
|
||||
|
|
|
|||
|
|
@ -165,7 +165,7 @@ Map* MapInstanced::CreateInstanceForPlayer(const uint32 mapId, Player* player)
|
|||
uint32 newInstanceId = sMapMgr->GenerateInstanceId();
|
||||
ASSERT(!FindInstanceMap(newInstanceId)); // pussywizard: instance with new id can't exist
|
||||
Difficulty diff = player->GetGroup() ? player->GetGroup()->GetDifficulty(IsRaid()) : player->GetDifficulty(IsRaid());
|
||||
map = CreateInstance(newInstanceId, NULL, diff);
|
||||
map = CreateInstance(newInstanceId, nullptr, diff);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -31,7 +31,7 @@ public:
|
|||
Map* FindInstanceMap(uint32 instanceId) const
|
||||
{
|
||||
InstancedMaps::const_iterator i = m_InstancedMaps.find(instanceId);
|
||||
return(i == m_InstancedMaps.end() ? NULL : i->second);
|
||||
return(i == m_InstancedMaps.end() ? nullptr : i->second);
|
||||
}
|
||||
bool DestroyInstance(InstancedMaps::iterator& itr);
|
||||
|
||||
|
|
|
|||
|
|
@ -32,7 +32,7 @@ public:
|
|||
Map* FindBaseMap(uint32 mapId) const // pussywizard: need this public for movemaps (mmaps)
|
||||
{
|
||||
MapMapType::const_iterator iter = i_maps.find(mapId);
|
||||
return (iter == i_maps.end() ? NULL : iter->second);
|
||||
return (iter == i_maps.end() ? nullptr : iter->second);
|
||||
}
|
||||
|
||||
uint32 GetAreaId(uint32 mapid, float x, float y, float z) const
|
||||
|
|
|
|||
|
|
@ -344,7 +344,7 @@ void TransportMgr::AddPathNodeToTransport(uint32 transportEntry, uint32 timeSeg,
|
|||
animNode.Path[timeSeg] = node;
|
||||
}
|
||||
|
||||
MotionTransport* TransportMgr::CreateTransport(uint32 entry, uint32 guid /*= 0*/, Map* map /*= NULL*/)
|
||||
MotionTransport* TransportMgr::CreateTransport(uint32 entry, uint32 guid /*= 0*/, Map* map /*= nullptr*/)
|
||||
{
|
||||
// instance case, execute GetGameObjectEntry hook
|
||||
if (map)
|
||||
|
|
|
|||
|
|
@ -368,7 +368,7 @@ GraveyardStruct const* Graveyard::GetGraveyard(const std::string& name) const
|
|||
{
|
||||
if (itr->second.wnameLow == wname)
|
||||
return &itr->second;
|
||||
else if (alt == NULL && itr->second.wnameLow.find(wname) != std::wstring::npos)
|
||||
else if (alt == nullptr && itr->second.wnameLow.find(wname) != std::wstring::npos)
|
||||
alt = &itr->second;
|
||||
}
|
||||
|
||||
|
|
|
|||
Some files were not shown because too many files have changed in this diff Show more
Loading…
Add table
Add a link
Reference in a new issue