mirror of
https://github.com/mod-playerbots/azerothcore-wotlk.git
synced 2026-01-24 06:06:23 +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:
@@ -950,7 +950,7 @@ public:
|
||||
uint32 GetSpellTypeMask() const { return _spellTypeMask; }
|
||||
uint32 GetSpellPhaseMask() const { return _spellPhaseMask; }
|
||||
uint32 GetHitMask() const { return _hitMask; }
|
||||
SpellInfo const* GetSpellInfo() const { return NULL; }
|
||||
SpellInfo const* GetSpellInfo() const { return nullptr; }
|
||||
SpellSchoolMask GetSchoolMask() const { return SPELL_SCHOOL_MASK_NONE; }
|
||||
DamageInfo* GetDamageInfo() const { return _damageInfo; }
|
||||
HealInfo* GetHealInfo() const { return _healInfo; }
|
||||
@@ -1419,13 +1419,13 @@ class Unit : public WorldObject
|
||||
}
|
||||
Unit* getAttackerForHelper() const // If someone wants to help, who to give them
|
||||
{
|
||||
if (GetVictim() != NULL)
|
||||
if (GetVictim() != nullptr)
|
||||
return GetVictim();
|
||||
|
||||
if (!m_attackers.empty())
|
||||
return *(m_attackers.begin());
|
||||
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
bool Attack(Unit* victim, bool meleeAttack);
|
||||
void CastStop(uint32 except_spellid = 0, bool withInstant = true);
|
||||
@@ -1440,8 +1440,8 @@ class Unit : public WorldObject
|
||||
void StopAttackFaction(uint32 faction_id);
|
||||
Unit* SelectNearbyTarget(Unit* exclude = NULL, float dist = NOMINAL_MELEE_RANGE) const;
|
||||
Unit* SelectNearbyNoTotemTarget(Unit* exclude = NULL, float dist = NOMINAL_MELEE_RANGE) const;
|
||||
void SendMeleeAttackStop(Unit* victim = NULL);
|
||||
void SendMeleeAttackStart(Unit* victim, Player* sendTo = NULL);
|
||||
void SendMeleeAttackStop(Unit* victim = nullptr);
|
||||
void SendMeleeAttackStart(Unit* victim, Player* sendTo = nullptr);
|
||||
|
||||
void AddUnitState(uint32 f) { m_state |= f; }
|
||||
bool HasUnitState(const uint32 f) const { return (m_state & f); }
|
||||
@@ -1481,7 +1481,7 @@ class Unit : public WorldObject
|
||||
uint32 GetResistance(SpellSchools school) const { return GetUInt32Value(UNIT_FIELD_RESISTANCES+school); }
|
||||
uint32 GetResistance(SpellSchoolMask mask) const;
|
||||
void SetResistance(SpellSchools school, int32 val) { SetStatInt32Value(UNIT_FIELD_RESISTANCES+school, val); }
|
||||
static float GetEffectiveResistChance(Unit const* owner, SpellSchoolMask schoolMask, Unit const* victim, SpellInfo const* spellInfo = NULL);
|
||||
static float GetEffectiveResistChance(Unit const* owner, SpellSchoolMask schoolMask, Unit const* victim, SpellInfo const* spellInfo = nullptr);
|
||||
|
||||
uint32 GetHealth() const { return GetUInt32Value(UNIT_FIELD_HEALTH); }
|
||||
uint32 GetMaxHealth() const { return GetUInt32Value(UNIT_FIELD_MAXHEALTH); }
|
||||
@@ -1577,14 +1577,14 @@ class Unit : public WorldObject
|
||||
void Mount(uint32 mount, uint32 vehicleId = 0, uint32 creatureEntry = 0);
|
||||
void Dismount();
|
||||
|
||||
uint16 GetMaxSkillValueForLevel(Unit const* target = NULL) const { return (target ? getLevelForTarget(target) : getLevel()) * 5; }
|
||||
uint16 GetMaxSkillValueForLevel(Unit const* target = nullptr) const { return (target ? getLevelForTarget(target) : getLevel()) * 5; }
|
||||
static void DealDamageMods(Unit const* victim, uint32 &damage, uint32* absorb);
|
||||
static uint32 DealDamage(Unit* attacker, Unit* victim, uint32 damage, CleanDamage const* cleanDamage = NULL, DamageEffectType damagetype = DIRECT_DAMAGE, SpellSchoolMask damageSchoolMask = SPELL_SCHOOL_MASK_NORMAL, SpellInfo const* spellProto = NULL, bool durabilityLoss = true, bool allowGM = false);
|
||||
static void Kill(Unit* killer, Unit* victim, bool durabilityLoss = true, WeaponAttackType attackType = BASE_ATTACK, SpellInfo const *spellProto = NULL);
|
||||
static void Kill(Unit* killer, Unit* victim, bool durabilityLoss = true, WeaponAttackType attackType = BASE_ATTACK, SpellInfo const *spellProto = nullptr);
|
||||
static int32 DealHeal(Unit* healer, Unit* victim, uint32 addhealth);
|
||||
|
||||
void ProcDamageAndSpell(Unit* victim, uint32 procAttacker, uint32 procVictim, uint32 procEx, uint32 amount, WeaponAttackType attType = BASE_ATTACK, SpellInfo const* procSpell = NULL, SpellInfo const* procAura = NULL);
|
||||
void ProcDamageAndSpellFor(bool isVictim, Unit* target, uint32 procFlag, uint32 procExtra, WeaponAttackType attType, SpellInfo const* procSpell, uint32 damage, SpellInfo const* procAura = NULL);
|
||||
void ProcDamageAndSpell(Unit* victim, uint32 procAttacker, uint32 procVictim, uint32 procEx, uint32 amount, WeaponAttackType attType = BASE_ATTACK, SpellInfo const* procSpell = NULL, SpellInfo const* procAura = nullptr);
|
||||
void ProcDamageAndSpellFor(bool isVictim, Unit* target, uint32 procFlag, uint32 procExtra, WeaponAttackType attType, SpellInfo const* procSpell, uint32 damage, SpellInfo const* procAura = nullptr);
|
||||
|
||||
void GetProcAurasTriggeredOnEvent(std::list<AuraApplication*>& aurasTriggeringProc, std::list<AuraApplication*>* procAuras, ProcEventInfo eventInfo);
|
||||
void TriggerAurasProcOnEvent(CalcDamageInfo& damageInfo);
|
||||
@@ -1655,9 +1655,9 @@ class Unit : public WorldObject
|
||||
|
||||
return value;
|
||||
}
|
||||
uint32 GetUnitMeleeSkill(Unit const* target = NULL) const { return (target ? getLevelForTarget(target) : getLevel()) * 5; }
|
||||
uint32 GetDefenseSkillValue(Unit const* target = NULL) const;
|
||||
uint32 GetWeaponSkillValue(WeaponAttackType attType, Unit const* target = NULL) const;
|
||||
uint32 GetUnitMeleeSkill(Unit const* target = nullptr) const { return (target ? getLevelForTarget(target) : getLevel()) * 5; }
|
||||
uint32 GetDefenseSkillValue(Unit const* target = nullptr) const;
|
||||
uint32 GetWeaponSkillValue(WeaponAttackType attType, Unit const* target = nullptr) const;
|
||||
float GetWeaponProcChance() const;
|
||||
float GetPPMProcChance(uint32 WeaponSpeed, float PPM, const SpellInfo* spellProto) const;
|
||||
|
||||
@@ -1706,7 +1706,7 @@ class Unit : public WorldObject
|
||||
bool HasAuraTypeWithFamilyFlags(AuraType auraType, uint32 familyName, uint32 familyFlags) const;
|
||||
bool virtual HasSpell(uint32 /*spellID*/) const { return false; }
|
||||
bool HasBreakableByDamageAuraType(AuraType type, uint32 excludeAura = 0) const;
|
||||
bool HasBreakableByDamageCrowdControlAura(Unit* excludeCasterChannel = NULL) const;
|
||||
bool HasBreakableByDamageCrowdControlAura(Unit* excludeCasterChannel = nullptr) const;
|
||||
|
||||
bool HasStealthAura() const { return HasAuraType(SPELL_AURA_MOD_STEALTH); }
|
||||
bool HasInvisibilityAura() const { return HasAuraType(SPELL_AURA_MOD_INVISIBILITY); }
|
||||
@@ -1716,10 +1716,10 @@ class Unit : public WorldObject
|
||||
|
||||
bool isFrozen() const;
|
||||
|
||||
bool isTargetableForAttack(bool checkFakeDeath = true, Unit const* byWho = NULL) const;
|
||||
bool isTargetableForAttack(bool checkFakeDeath = true, Unit const* byWho = nullptr) const;
|
||||
|
||||
bool IsValidAttackTarget(Unit const* target) const;
|
||||
bool _IsValidAttackTarget(Unit const* target, SpellInfo const* bySpell, WorldObject const* obj = NULL) const;
|
||||
bool _IsValidAttackTarget(Unit const* target, SpellInfo const* bySpell, WorldObject const* obj = nullptr) const;
|
||||
|
||||
bool IsValidAssistTarget(Unit const* target) const;
|
||||
bool _IsValidAssistTarget(Unit const* target, SpellInfo const* bySpell) const;
|
||||
@@ -1781,8 +1781,8 @@ class Unit : public WorldObject
|
||||
|
||||
void SendMonsterMove(float NewPosX, float NewPosY, float NewPosZ, uint32 TransitTime, SplineFlags sf = SPLINEFLAG_WALK_MODE); // pussywizard: need to just send packet, with no shitty movement/spline
|
||||
void MonsterMoveWithSpeed(float x, float y, float z, float speed);
|
||||
//void SetFacing(float ori, WorldObject* obj = NULL);
|
||||
//void SendMonsterMove(float NewPosX, float NewPosY, float NewPosZ, uint8 type, uint32 MovementFlags, uint32 Time, Player* player = NULL);
|
||||
//void SetFacing(float ori, WorldObject* obj = nullptr);
|
||||
//void SendMonsterMove(float NewPosX, float NewPosY, float NewPosZ, uint8 type, uint32 MovementFlags, uint32 Time, Player* player = nullptr);
|
||||
void SendMovementFlagUpdate(bool self = false);
|
||||
|
||||
bool IsLevitating() const { return m_movementInfo.HasMovementFlag(MOVEMENTFLAG_DISABLE_GRAVITY); }
|
||||
@@ -1867,7 +1867,7 @@ class Unit : public WorldObject
|
||||
void RemoveAllMinionsByEntry(uint32 entry);
|
||||
void SetCharm(Unit* target, bool apply);
|
||||
Unit* GetNextRandomRaidMemberOrPet(float radius);
|
||||
bool SetCharmedBy(Unit* charmer, CharmType type, AuraApplication const* aurApp = NULL);
|
||||
bool SetCharmedBy(Unit* charmer, CharmType type, AuraApplication const* aurApp = nullptr);
|
||||
void RemoveCharmedBy(Unit* charmer);
|
||||
void RestoreFaction();
|
||||
|
||||
@@ -1925,7 +1925,7 @@ class Unit : public WorldObject
|
||||
void RemoveOwnedAura(uint32 spellId, uint64 casterGUID = 0, uint8 reqEffMask = 0, AuraRemoveMode removeMode = AURA_REMOVE_BY_DEFAULT);
|
||||
void RemoveOwnedAura(Aura* aura, AuraRemoveMode removeMode = AURA_REMOVE_BY_DEFAULT);
|
||||
|
||||
Aura* GetOwnedAura(uint32 spellId, uint64 casterGUID = 0, uint64 itemCasterGUID = 0, uint8 reqEffMask = 0, Aura* except = NULL) const;
|
||||
Aura* GetOwnedAura(uint32 spellId, uint64 casterGUID = 0, uint64 itemCasterGUID = 0, uint8 reqEffMask = 0, Aura* except = nullptr) const;
|
||||
|
||||
// m_appliedAuras container management
|
||||
AuraApplicationMap & GetAppliedAuras() { return m_appliedAuras; }
|
||||
@@ -1974,10 +1974,10 @@ class Unit : public WorldObject
|
||||
AuraEffect * GetAuraEffectDummy(uint32 spellid) const;
|
||||
inline AuraEffect* GetDummyAuraEffect(SpellFamilyNames name, uint32 iconId, uint8 effIndex) const { return GetAuraEffect(SPELL_AURA_DUMMY, name, iconId, effIndex);}
|
||||
|
||||
AuraApplication * GetAuraApplication(uint32 spellId, uint64 casterGUID = 0, uint64 itemCasterGUID = 0, uint8 reqEffMask = 0, AuraApplication * except = NULL) const;
|
||||
AuraApplication * GetAuraApplication(uint32 spellId, uint64 casterGUID = 0, uint64 itemCasterGUID = 0, uint8 reqEffMask = 0, AuraApplication * except = nullptr) const;
|
||||
Aura* GetAura(uint32 spellId, uint64 casterGUID = 0, uint64 itemCasterGUID = 0, uint8 reqEffMask = 0) const;
|
||||
|
||||
AuraApplication * GetAuraApplicationOfRankedSpell(uint32 spellId, uint64 casterGUID = 0, uint64 itemCasterGUID = 0, uint8 reqEffMask = 0, AuraApplication * except = NULL) const;
|
||||
AuraApplication * GetAuraApplicationOfRankedSpell(uint32 spellId, uint64 casterGUID = 0, uint64 itemCasterGUID = 0, uint8 reqEffMask = 0, AuraApplication * except = nullptr) const;
|
||||
Aura* GetAuraOfRankedSpell(uint32 spellId, uint64 casterGUID = 0, uint64 itemCasterGUID = 0, uint8 reqEffMask = 0) const;
|
||||
|
||||
void GetDispellableAuraList(Unit* caster, uint32 dispelMask, DispelChargesList& dispelList);
|
||||
@@ -2007,7 +2007,7 @@ class Unit : public WorldObject
|
||||
|
||||
int32 GetTotalAuraModifierByMiscMask(AuraType auratype, uint32 misc_mask) const;
|
||||
float GetTotalAuraMultiplierByMiscMask(AuraType auratype, uint32 misc_mask) const;
|
||||
int32 GetMaxPositiveAuraModifierByMiscMask(AuraType auratype, uint32 misc_mask, const AuraEffect* except = NULL) const;
|
||||
int32 GetMaxPositiveAuraModifierByMiscMask(AuraType auratype, uint32 misc_mask, const AuraEffect* except = nullptr) const;
|
||||
int32 GetMaxNegativeAuraModifierByMiscMask(AuraType auratype, uint32 misc_mask) const;
|
||||
|
||||
int32 GetTotalAuraModifierByMiscValue(AuraType auratype, int32 misc_value) const;
|
||||
@@ -2117,7 +2117,7 @@ class Unit : public WorldObject
|
||||
virtual void UpdateMaxPower(Powers power) = 0;
|
||||
virtual void UpdateAttackPowerAndDamage(bool ranged = false) = 0;
|
||||
virtual void UpdateDamagePhysical(WeaponAttackType attType);
|
||||
float GetTotalAttackPowerValue(WeaponAttackType attType, Unit *pVictim = NULL) const;
|
||||
float GetTotalAttackPowerValue(WeaponAttackType attType, Unit *pVictim = nullptr) const;
|
||||
float GetWeaponDamageRange(WeaponAttackType attType, WeaponDamageRange type) const;
|
||||
void SetBaseWeaponDamage(WeaponAttackType attType, WeaponDamageRange damageRange, float value) { m_weaponDamage[attType][damageRange] = value; }
|
||||
virtual void CalculateMinMaxDamage(WeaponAttackType attType, bool normalized, bool addTotalPct, float& minDamage, float& maxDamage) = 0;
|
||||
@@ -2142,7 +2142,7 @@ class Unit : public WorldObject
|
||||
|
||||
// Threat related methods
|
||||
bool CanHaveThreatList() const;
|
||||
void AddThreat(Unit* victim, float fThreat, SpellSchoolMask schoolMask = SPELL_SCHOOL_MASK_NORMAL, SpellInfo const* threatSpell = NULL);
|
||||
void AddThreat(Unit* victim, float fThreat, SpellSchoolMask schoolMask = SPELL_SCHOOL_MASK_NORMAL, SpellInfo const* threatSpell = nullptr);
|
||||
float ApplyTotalThreatModifier(float fThreat, SpellSchoolMask schoolMask = SPELL_SCHOOL_MASK_NORMAL);
|
||||
void DeleteThreatList();
|
||||
void TauntApply(Unit* victim);
|
||||
@@ -2190,10 +2190,10 @@ class Unit : public WorldObject
|
||||
|
||||
void ModifyAuraState(AuraStateType flag, bool apply);
|
||||
uint32 BuildAuraStateUpdateForTarget(Unit* target) const;
|
||||
bool HasAuraState(AuraStateType flag, SpellInfo const* spellProto = NULL, Unit const* Caster = NULL) const;
|
||||
bool HasAuraState(AuraStateType flag, SpellInfo const* spellProto = NULL, Unit const* Caster = nullptr) const;
|
||||
void UnsummonAllTotems();
|
||||
Unit* GetMagicHitRedirectTarget(Unit* victim, SpellInfo const* spellInfo);
|
||||
Unit* GetMeleeHitRedirectTarget(Unit* victim, SpellInfo const* spellInfo = NULL);
|
||||
Unit* GetMeleeHitRedirectTarget(Unit* victim, SpellInfo const* spellInfo = nullptr);
|
||||
|
||||
int32 SpellBaseDamageBonusDone(SpellSchoolMask schoolMask);
|
||||
int32 SpellBaseDamageBonusTaken(SpellSchoolMask schoolMask, bool isDoT = false);
|
||||
@@ -2206,8 +2206,8 @@ class Unit : public WorldObject
|
||||
uint32 SpellHealingBonusDone(Unit* victim, SpellInfo const *spellProto, uint32 healamount, DamageEffectType damagetype, float TotalMod = 0.0f, uint32 stack = 1);
|
||||
uint32 SpellHealingBonusTaken(Unit* caster, SpellInfo const *spellProto, uint32 healamount, DamageEffectType damagetype, uint32 stack = 1);
|
||||
|
||||
uint32 MeleeDamageBonusDone(Unit *pVictim, uint32 damage, WeaponAttackType attType, SpellInfo const *spellProto = NULL);
|
||||
uint32 MeleeDamageBonusTaken(Unit* attacker, uint32 pdamage,WeaponAttackType attType, SpellInfo const *spellProto = NULL);
|
||||
uint32 MeleeDamageBonusDone(Unit *pVictim, uint32 damage, WeaponAttackType attType, SpellInfo const *spellProto = nullptr);
|
||||
uint32 MeleeDamageBonusTaken(Unit* attacker, uint32 pdamage,WeaponAttackType attType, SpellInfo const *spellProto = nullptr);
|
||||
|
||||
bool isSpellBlocked(Unit* victim, SpellInfo const* spellProto, WeaponAttackType attackType = BASE_ATTACK);
|
||||
bool isBlockCritical();
|
||||
@@ -2219,7 +2219,7 @@ class Unit : public WorldObject
|
||||
void SetLastManaUse(uint32 spellCastTime) { m_lastManaUse = spellCastTime; }
|
||||
bool IsUnderLastManaUseEffect() const;
|
||||
|
||||
void SetContestedPvP(Player* attackedPlayer = NULL);
|
||||
void SetContestedPvP(Player* attackedPlayer = nullptr);
|
||||
|
||||
uint32 GetCastingTimeForBonus(SpellInfo const* spellProto, DamageEffectType damagetype, uint32 CastingTime) const;
|
||||
float CalculateDefaultCoefficient(SpellInfo const *spellInfo, DamageEffectType damagetype) const;
|
||||
@@ -2250,7 +2250,7 @@ class Unit : public WorldObject
|
||||
void SetSpeedRate(UnitMoveType mtype, float rate) { m_speed_rate[mtype] = rate; }
|
||||
|
||||
float ApplyEffectModifiers(SpellInfo const* spellProto, uint8 effect_index, float value) const;
|
||||
int32 CalculateSpellDamage(Unit const* target, SpellInfo const* spellProto, uint8 effect_index, int32 const* basePoints = NULL) const;
|
||||
int32 CalculateSpellDamage(Unit const* target, SpellInfo const* spellProto, uint8 effect_index, int32 const* basePoints = nullptr) const;
|
||||
int32 CalcSpellDuration(SpellInfo const* spellProto);
|
||||
int32 ModSpellDuration(SpellInfo const* spellProto, Unit const* target, int32 duration, bool positive, uint32 effectMask);
|
||||
void ModSpellCastTime(SpellInfo const* spellProto, int32 & castTime, Spell * spell=NULL);
|
||||
@@ -2351,12 +2351,12 @@ class Unit : public WorldObject
|
||||
bool HandleSpellClick(Unit* clicker, int8 seatId = -1);
|
||||
void EnterVehicle(Unit* base, int8 seatId = -1);
|
||||
void EnterVehicleUnattackable(Unit *base, int8 seatId = -1);
|
||||
void ExitVehicle(Position const* exitPosition = NULL);
|
||||
void ExitVehicle(Position const* exitPosition = nullptr);
|
||||
void ChangeSeat(int8 seatId, bool next = true);
|
||||
|
||||
// Should only be called by AuraEffect::HandleAuraControlVehicle(AuraApplication const* auraApp, uint8 mode, bool apply) const;
|
||||
void _ExitVehicle(Position const* exitPosition = NULL);
|
||||
void _EnterVehicle(Vehicle* vehicle, int8 seatId, AuraApplication const* aurApp = NULL);
|
||||
void _ExitVehicle(Position const* exitPosition = nullptr);
|
||||
void _EnterVehicle(Vehicle* vehicle, int8 seatId, AuraApplication const* aurApp = nullptr);
|
||||
|
||||
void BuildMovementPacket(ByteBuffer *data) const;
|
||||
|
||||
@@ -2378,15 +2378,15 @@ class Unit : public WorldObject
|
||||
virtual bool isBeingLoaded() const { return false;}
|
||||
bool IsDuringRemoveFromWorld() const {return m_duringRemoveFromWorld;}
|
||||
|
||||
Pet* ToPet(){ if (IsPet()) return reinterpret_cast<Pet*>(this); else return NULL; }
|
||||
Totem* ToTotem(){ if (IsTotem()) return reinterpret_cast<Totem*>(this); else return NULL; }
|
||||
TempSummon* ToTempSummon() { if (IsSummon()) return reinterpret_cast<TempSummon*>(this); else return NULL; }
|
||||
const TempSummon* ToTempSummon() const { if (IsSummon()) return reinterpret_cast<const TempSummon*>(this); else return NULL; }
|
||||
Pet* ToPet(){ if (IsPet()) return reinterpret_cast<Pet*>(this); else return nullptr; }
|
||||
Totem* ToTotem(){ if (IsTotem()) return reinterpret_cast<Totem*>(this); else return nullptr; }
|
||||
TempSummon* ToTempSummon() { if (IsSummon()) return reinterpret_cast<TempSummon*>(this); else return nullptr; }
|
||||
const TempSummon* ToTempSummon() const { if (IsSummon()) return reinterpret_cast<const TempSummon*>(this); else return nullptr; }
|
||||
|
||||
// pussywizard:
|
||||
// MMaps
|
||||
std::map<uint64, MMapTargetData> m_targetsNotAcceptable;
|
||||
bool isTargetNotAcceptableByMMaps(uint64 guid, uint32 currTime, const Position* t = NULL) const { std::map<uint64, MMapTargetData>::const_iterator itr = m_targetsNotAcceptable.find(guid); if (itr != m_targetsNotAcceptable.end() && (itr->second._endTime >= currTime || (t && !itr->second.PosChanged(*this, *t)))) return true; return false; }
|
||||
bool isTargetNotAcceptableByMMaps(uint64 guid, uint32 currTime, const Position* t = nullptr) const { std::map<uint64, MMapTargetData>::const_iterator itr = m_targetsNotAcceptable.find(guid); if (itr != m_targetsNotAcceptable.end() && (itr->second._endTime >= currTime || (t && !itr->second.PosChanged(*this, *t)))) return true; return false; }
|
||||
uint32 m_mmapNotAcceptableStartTime;
|
||||
// Safe mover
|
||||
std::set<SafeUnitPointer*> SafeUnitPointerSet;
|
||||
|
||||
Reference in New Issue
Block a user