refactor(Core): replace NULL with nullptr (#4593)

This commit is contained in:
Kitzunu
2021-03-02 01:34:20 +01:00
committed by GitHub
parent dbefa17a53
commit 28f1dc5c0c
231 changed files with 923 additions and 923 deletions

View File

@@ -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))

View File

@@ -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;

View File

@@ -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];