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

@@ -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;
}
//============================================================

View File

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