mirror of
https://github.com/mod-playerbots/azerothcore-wotlk.git
synced 2026-02-04 19:43:48 +00:00
refactor(Core): NULL -> nullptr (#3275)
* NULL to nullptr * NULL to nullptr * NULL to nullptr * NULL to nullptr * NULL to nullptr Co-authored-by: Francesco Borzì <borzifrancesco@gmail.com> Co-authored-by: Stefano Borzì <stefanoborzi32@gmail.com>
This commit is contained in:
@@ -25,10 +25,10 @@
|
||||
|
||||
#define PET_XP_FACTOR 0.05f
|
||||
|
||||
Pet::Pet(Player* owner, PetType type) : Guardian(NULL, owner ? owner->GetGUID() : 0, true),
|
||||
Pet::Pet(Player* owner, PetType type) : Guardian(nullptr, owner ? owner->GetGUID() : 0, true),
|
||||
m_usedTalentCount(0), m_removed(false), m_owner(owner),
|
||||
m_happinessTimer(PET_LOSE_HAPPINES_INTERVAL), m_petType(type), m_duration(0),
|
||||
m_auraRaidUpdateMask(0), m_loading(false), m_petRegenTimer(PET_FOCUS_REGEN_INTERVAL), m_declinedname(NULL), m_tempspellTarget(NULL), m_tempoldTarget(NULL), m_tempspellIsPositive(false), m_tempspell(0), asynchLoadType(PET_LOAD_DEFAULT)
|
||||
m_auraRaidUpdateMask(0), m_loading(false), m_petRegenTimer(PET_FOCUS_REGEN_INTERVAL), m_declinedname(nullptr), m_tempspellTarget(nullptr), m_tempoldTarget(nullptr), m_tempspellIsPositive(false), m_tempspell(0), asynchLoadType(PET_LOAD_DEFAULT)
|
||||
{
|
||||
m_unitTypeMask |= UNIT_MASK_PET;
|
||||
if (type == HUNTER_PET)
|
||||
@@ -289,7 +289,7 @@ void Pet::SavePetToDB(PetSaveMode mode, bool logout)
|
||||
stmt->setUInt32(12, curhealth);
|
||||
stmt->setUInt32(13, curmana);
|
||||
stmt->setUInt32(14, GetPower(POWER_HAPPINESS));
|
||||
stmt->setUInt32(15, time(NULL));
|
||||
stmt->setUInt32(15, time(nullptr));
|
||||
|
||||
std::ostringstream ss;
|
||||
for (uint32 i = ACTION_BAR_INDEX_START; i < ACTION_BAR_INDEX_END; ++i)
|
||||
@@ -373,7 +373,7 @@ void Pet::Update(uint32 diff)
|
||||
{
|
||||
case CORPSE:
|
||||
{
|
||||
if (getPetType() != HUNTER_PET || m_corpseRemoveTime <= time(NULL))
|
||||
if (getPetType() != HUNTER_PET || m_corpseRemoveTime <= time(nullptr))
|
||||
{
|
||||
Remove(PET_SAVE_NOT_IN_SLOT); //hunters' pets never get removed because of death, NEVER!
|
||||
return;
|
||||
@@ -463,7 +463,7 @@ void Pet::Update(uint32 diff)
|
||||
|
||||
CastSpell(tempspellTarget, tempspell, true);
|
||||
m_tempspell = 0;
|
||||
m_tempspellTarget = NULL;
|
||||
m_tempspellTarget = nullptr;
|
||||
|
||||
if (tempspellIsPositive)
|
||||
{
|
||||
@@ -489,7 +489,7 @@ void Pet::Update(uint32 diff)
|
||||
GetMotionMaster()->MoveFollow(charmer, PET_FOLLOW_DIST, GetFollowAngle());
|
||||
}
|
||||
|
||||
m_tempoldTarget = NULL;
|
||||
m_tempoldTarget = nullptr;
|
||||
m_tempspellIsPositive = false;
|
||||
}
|
||||
}
|
||||
@@ -498,8 +498,8 @@ void Pet::Update(uint32 diff)
|
||||
else
|
||||
{
|
||||
m_tempspell = 0;
|
||||
m_tempspellTarget = NULL;
|
||||
m_tempoldTarget = NULL;
|
||||
m_tempspellTarget = nullptr;
|
||||
m_tempoldTarget = nullptr;
|
||||
m_tempspellIsPositive = false;
|
||||
|
||||
Unit* victim = charmer->GetVictim();
|
||||
@@ -1060,7 +1060,7 @@ bool Guardian::InitStatsForLevel(uint8 petlevel)
|
||||
|
||||
// xinef: fixes orc death knight command racial
|
||||
if (owner->getRace() == RACE_ORC)
|
||||
CastSpell(this, SPELL_ORC_RACIAL_COMMAND, true, NULL, NULL, owner->GetGUID());
|
||||
CastSpell(this, SPELL_ORC_RACIAL_COMMAND, true, nullptr, nullptr, owner->GetGUID());
|
||||
|
||||
// Avoidance, Night of the Dead
|
||||
if (Aura *aur = AddAura(SPELL_NIGHT_OF_THE_DEAD_AVOIDANCE, this))
|
||||
@@ -1128,7 +1128,7 @@ void Pet::_LoadSpellCooldowns(PreparedQueryResult result)
|
||||
|
||||
if (result)
|
||||
{
|
||||
time_t curTime = time(NULL);
|
||||
time_t curTime = time(nullptr);
|
||||
|
||||
PacketCooldowns cooldowns;
|
||||
WorldPacket data;
|
||||
@@ -1174,7 +1174,7 @@ void Pet::_SaveSpellCooldowns(SQLTransaction& trans, bool logout)
|
||||
stmt->setUInt32(0, m_charmInfo->GetPetNumber());
|
||||
trans->Append(stmt);
|
||||
|
||||
time_t curTime = time(NULL);
|
||||
time_t curTime = time(nullptr);
|
||||
uint32 checkTime = World::GetGameTimeMS() + 30*IN_MILLISECONDS;
|
||||
|
||||
// remove oudated and save active
|
||||
@@ -1587,7 +1587,7 @@ void Pet::InitLevelupSpellsForLevel()
|
||||
{
|
||||
uint8 level = getLevel();
|
||||
|
||||
if (PetLevelupSpellSet const* levelupSpells = GetCreatureTemplate()->family ? sSpellMgr->GetPetLevelupSpellList(GetCreatureTemplate()->family) : NULL)
|
||||
if (PetLevelupSpellSet const* levelupSpells = GetCreatureTemplate()->family ? sSpellMgr->GetPetLevelupSpellList(GetCreatureTemplate()->family) : nullptr)
|
||||
{
|
||||
// PetLevelupSpellSet ordered by levels, process in reversed order
|
||||
for (PetLevelupSpellSet::const_reverse_iterator itr = levelupSpells->rbegin(); itr != levelupSpells->rend(); ++itr)
|
||||
@@ -2157,7 +2157,7 @@ void Pet::HandleAsynchLoadSucceed()
|
||||
// Warlock pet exception, check if owner is casting new summon spell
|
||||
if (Spell* spell = owner->GetCurrentSpell(CURRENT_GENERIC_SPELL))
|
||||
if (spell->GetSpellInfo()->HasEffect(SPELL_EFFECT_SUMMON_PET))
|
||||
CastSpell(this, 32752, true, NULL, NULL, GetGUID());
|
||||
CastSpell(this, 32752, true, nullptr, nullptr, GetGUID());
|
||||
|
||||
|
||||
if (owner->NeedSendSpectatorData() && GetCreatureTemplate()->family)
|
||||
@@ -2215,7 +2215,7 @@ void Pet::HandleAsynchLoadFailed(AsynchPetSummon* info, Player* player, uint8 as
|
||||
pet->SetUInt32Value(UNIT_FIELD_PETNEXTLEVELEXP, 1000);
|
||||
pet->SetFullHealth();
|
||||
pet->SetPower(POWER_MANA, pet->GetMaxPower(POWER_MANA));
|
||||
pet->SetUInt32Value(UNIT_FIELD_PET_NAME_TIMESTAMP, uint32(time(NULL))); // cast can't be helped in this case
|
||||
pet->SetUInt32Value(UNIT_FIELD_PET_NAME_TIMESTAMP, uint32(time(nullptr))); // cast can't be helped in this case
|
||||
}
|
||||
|
||||
map->AddToMap(pet->ToCreature(), true);
|
||||
@@ -2324,8 +2324,8 @@ void Pet::ClearCastWhenWillAvailable()
|
||||
{
|
||||
m_tempspellIsPositive = false;
|
||||
m_tempspell = 0;
|
||||
m_tempspellTarget = NULL;
|
||||
m_tempoldTarget = NULL;
|
||||
m_tempspellTarget = nullptr;
|
||||
m_tempoldTarget = nullptr;
|
||||
}
|
||||
|
||||
void Pet::RemoveSpellCooldown(uint32 spell_id, bool update /* = false */)
|
||||
|
||||
@@ -64,7 +64,7 @@ class Pet : public Guardian
|
||||
bool CreateBaseAtCreatureInfo(CreatureTemplate const* cinfo, Unit* owner);
|
||||
bool CreateBaseAtTamed(CreatureTemplate const* cinfo, Map* map, uint32 phaseMask);
|
||||
static SpellCastResult TryLoadFromDB(Player* owner, bool current = false, PetType mandatoryPetType = MAX_PET_TYPE);
|
||||
static bool LoadPetFromDB(Player* owner, uint8 asynchLoadType, uint32 petentry = 0, uint32 petnumber = 0, bool current = false, AsynchPetSummon* info = NULL);
|
||||
static bool LoadPetFromDB(Player* owner, uint8 asynchLoadType, uint32 petentry = 0, uint32 petnumber = 0, bool current = false, AsynchPetSummon* info = nullptr);
|
||||
bool isBeingLoaded() const override { return m_loading;}
|
||||
void SavePetToDB(PetSaveMode mode, bool logout);
|
||||
void Remove(PetSaveMode mode, bool returnreagent = false);
|
||||
@@ -136,7 +136,7 @@ class Pet : public Guardian
|
||||
void InitPetCreateSpells();
|
||||
|
||||
bool resetTalents();
|
||||
static void resetTalentsForAllPetsOf(Player* owner, Pet* online_pet = NULL);
|
||||
static void resetTalentsForAllPetsOf(Player* owner, Pet* online_pet = nullptr);
|
||||
void InitTalentForLevel();
|
||||
|
||||
uint8 GetMaxTalentPointsForLevel(uint8 level);
|
||||
|
||||
Reference in New Issue
Block a user