mirror of
https://github.com/mod-playerbots/azerothcore-wotlk.git
synced 2026-01-30 00:53:46 +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:
File diff suppressed because it is too large
Load Diff
@@ -143,7 +143,7 @@ enum TalentTree // talent tabs
|
||||
// Spell modifier (used for modify other spells)
|
||||
struct SpellModifier
|
||||
{
|
||||
SpellModifier(Aura* _ownerAura = NULL) : op(SPELLMOD_DAMAGE), type(SPELLMOD_FLAT), charges(0), value(0), mask(), spellId(0), ownerAura(_ownerAura) {}
|
||||
SpellModifier(Aura* _ownerAura = nullptr) : op(SPELLMOD_DAMAGE), type(SPELLMOD_FLAT), charges(0), value(0), mask(), spellId(0), ownerAura(_ownerAura) {}
|
||||
SpellModOp op : 8;
|
||||
SpellModType type : 8;
|
||||
int16 charges : 16;
|
||||
@@ -257,7 +257,7 @@ struct PlayerClassLevelInfo
|
||||
|
||||
struct PlayerClassInfo
|
||||
{
|
||||
PlayerClassInfo() : levelInfo(NULL) { }
|
||||
PlayerClassInfo() : levelInfo(nullptr) { }
|
||||
|
||||
PlayerClassLevelInfo* levelInfo; //[level-1] 0..MaxPlayerLevel-1
|
||||
};
|
||||
@@ -286,7 +286,7 @@ typedef std::list<PlayerCreateInfoAction> PlayerCreateInfoActions;
|
||||
struct PlayerInfo
|
||||
{
|
||||
// existence checked by displayId != 0
|
||||
PlayerInfo() : mapId(0), areaId(0), positionX(0.0f), positionY(0.0f), positionZ(0.0f), orientation(0.0f), displayId_m(0), displayId_f(0), levelInfo(NULL) { }
|
||||
PlayerInfo() : mapId(0), areaId(0), positionX(0.0f), positionY(0.0f), positionZ(0.0f), orientation(0.0f), displayId_m(0), displayId_f(0), levelInfo(nullptr) { }
|
||||
|
||||
uint32 mapId;
|
||||
uint32 areaId;
|
||||
@@ -316,7 +316,7 @@ struct PvPInfo
|
||||
|
||||
struct DuelInfo
|
||||
{
|
||||
DuelInfo() : initiator(NULL), opponent(NULL), startTimer(0), startTime(0), outOfBound(0), isMounted(false) {}
|
||||
DuelInfo() : initiator(nullptr), opponent(nullptr), startTimer(0), startTime(0), outOfBound(0), isMounted(false) {}
|
||||
|
||||
Player* initiator;
|
||||
Player* opponent;
|
||||
@@ -380,7 +380,7 @@ struct Runes
|
||||
|
||||
struct EnchantDuration
|
||||
{
|
||||
EnchantDuration() : item(NULL), slot(MAX_ENCHANTMENT_SLOT), leftduration(0) {};
|
||||
EnchantDuration() : item(nullptr), slot(MAX_ENCHANTMENT_SLOT), leftduration(0) {};
|
||||
EnchantDuration(Item* _item, EnchantmentSlot _slot, uint32 _leftduration) : item(_item), slot(_slot),
|
||||
leftduration(_leftduration){ ASSERT(item); };
|
||||
|
||||
@@ -1065,7 +1065,7 @@ class TradeData
|
||||
void SetItem(TradeSlots slot, Item* item);
|
||||
|
||||
uint32 GetSpell() const { return m_spell; }
|
||||
void SetSpell(uint32 spell_id, Item* castItem = NULL);
|
||||
void SetSpell(uint32 spell_id, Item* castItem = nullptr);
|
||||
|
||||
Item* GetSpellCastItem() const;
|
||||
bool HasSpellCastItem() const { return m_spellCastItem != 0; }
|
||||
@@ -1161,14 +1161,14 @@ class Player : public Unit, public GridObject<Player>
|
||||
|
||||
void SetSummonPoint(uint32 mapid, float x, float y, float z, uint32 delay = 0, bool asSpectator = false)
|
||||
{
|
||||
m_summon_expire = time(NULL) + (delay ? delay : MAX_PLAYER_SUMMON_DELAY);
|
||||
m_summon_expire = time(nullptr) + (delay ? delay : MAX_PLAYER_SUMMON_DELAY);
|
||||
m_summon_mapid = mapid;
|
||||
m_summon_x = x;
|
||||
m_summon_y = y;
|
||||
m_summon_z = z;
|
||||
m_summon_asSpectator = asSpectator;
|
||||
}
|
||||
bool IsSummonAsSpectator() const { return m_summon_asSpectator && m_summon_expire >= time(NULL); }
|
||||
bool IsSummonAsSpectator() const { return m_summon_asSpectator && m_summon_expire >= time(nullptr); }
|
||||
void SetSummonAsSpectator(bool on) { m_summon_asSpectator = on; }
|
||||
void SummonIfPossible(bool agree, uint32 summoner_guid);
|
||||
time_t GetSummonExpireTimer() const { return m_summon_expire; }
|
||||
@@ -1271,8 +1271,8 @@ class Player : public Unit, public GridObject<Player>
|
||||
void SetVirtualItemSlot(uint8 i, Item* item);
|
||||
void SetSheath(SheathState sheathed) override; // overwrite Unit version
|
||||
uint8 FindEquipSlot(ItemTemplate const* proto, uint32 slot, bool swap) const;
|
||||
uint32 GetItemCount(uint32 item, bool inBankAlso = false, Item* skipItem = NULL) const;
|
||||
uint32 GetItemCountWithLimitCategory(uint32 limitCategory, Item* skipItem = NULL) const;
|
||||
uint32 GetItemCount(uint32 item, bool inBankAlso = false, Item* skipItem = nullptr) const;
|
||||
uint32 GetItemCountWithLimitCategory(uint32 limitCategory, Item* skipItem = nullptr) const;
|
||||
Item* GetItemByGuid(uint64 guid) const;
|
||||
Item* GetItemByEntry(uint32 entry) const;
|
||||
Item* GetItemByPos(uint16 pos) const;
|
||||
@@ -1281,7 +1281,7 @@ class Player : public Unit, public GridObject<Player>
|
||||
inline Item* GetUseableItemByPos(uint8 bag, uint8 slot) const //Does additional check for disarmed weapons
|
||||
{
|
||||
if (!CanUseAttackType(GetAttackBySlot(slot)))
|
||||
return NULL;
|
||||
return nullptr;
|
||||
return GetItemByPos(bag, slot);
|
||||
}
|
||||
Item* GetWeaponForAttack(WeaponAttackType attackType, bool useable = false) const;
|
||||
@@ -1300,13 +1300,13 @@ class Player : public Unit, public GridObject<Player>
|
||||
uint8 GetBankBagSlotCount() const { return GetByteValue(PLAYER_BYTES_2, 2); }
|
||||
void SetBankBagSlotCount(uint8 count) { SetByteValue(PLAYER_BYTES_2, 2, count); }
|
||||
bool HasItemCount(uint32 item, uint32 count = 1, bool inBankAlso = false) const;
|
||||
bool HasItemFitToSpellRequirements(SpellInfo const* spellInfo, Item const* ignoreItem = NULL) const;
|
||||
bool HasItemFitToSpellRequirements(SpellInfo const* spellInfo, Item const* ignoreItem = nullptr) const;
|
||||
bool CanNoReagentCast(SpellInfo const* spellInfo) const;
|
||||
bool HasItemOrGemWithIdEquipped(uint32 item, uint32 count, uint8 except_slot = NULL_SLOT) const;
|
||||
bool HasItemOrGemWithLimitCategoryEquipped(uint32 limitCategory, uint32 count, uint8 except_slot = NULL_SLOT) const;
|
||||
InventoryResult CanTakeMoreSimilarItems(Item* pItem) const { return CanTakeMoreSimilarItems(pItem->GetEntry(), pItem->GetCount(), pItem); }
|
||||
InventoryResult CanTakeMoreSimilarItems(uint32 entry, uint32 count) const { return CanTakeMoreSimilarItems(entry, count, NULL); }
|
||||
InventoryResult CanStoreNewItem(uint8 bag, uint8 slot, ItemPosCountVec& dest, uint32 item, uint32 count, uint32* no_space_count = NULL) const
|
||||
InventoryResult CanTakeMoreSimilarItems(uint32 entry, uint32 count) const { return CanTakeMoreSimilarItems(entry, count, nullptr); }
|
||||
InventoryResult CanStoreNewItem(uint8 bag, uint8 slot, ItemPosCountVec& dest, uint32 item, uint32 count, uint32* no_space_count = nullptr) const
|
||||
{
|
||||
return CanStoreItem(bag, slot, dest, item, count, NULL, false, no_space_count);
|
||||
}
|
||||
@@ -1315,7 +1315,7 @@ class Player : public Unit, public GridObject<Player>
|
||||
if (!pItem)
|
||||
return EQUIP_ERR_ITEM_NOT_FOUND;
|
||||
uint32 count = pItem->GetCount();
|
||||
return CanStoreItem(bag, slot, dest, pItem->GetEntry(), count, pItem, swap, NULL);
|
||||
return CanStoreItem(bag, slot, dest, pItem->GetEntry(), count, pItem, swap, nullptr);
|
||||
}
|
||||
InventoryResult CanStoreItems(Item** pItem, int32 count) const;
|
||||
InventoryResult CanEquipNewItem(uint8 slot, uint16& dest, uint32 item, bool swap) const;
|
||||
@@ -1345,8 +1345,8 @@ class Player : public Unit, public GridObject<Player>
|
||||
void UpdateLootAchievements(LootItem *item, Loot* loot);
|
||||
void UpdateTitansGrip();
|
||||
|
||||
InventoryResult CanTakeMoreSimilarItems(uint32 entry, uint32 count, Item* pItem, uint32* no_space_count = NULL) const;
|
||||
InventoryResult CanStoreItem(uint8 bag, uint8 slot, ItemPosCountVec& dest, uint32 entry, uint32 count, Item* pItem = NULL, bool swap = false, uint32* no_space_count = NULL) const;
|
||||
InventoryResult CanTakeMoreSimilarItems(uint32 entry, uint32 count, Item* pItem, uint32* no_space_count = nullptr) const;
|
||||
InventoryResult CanStoreItem(uint8 bag, uint8 slot, ItemPosCountVec& dest, uint32 entry, uint32 count, Item* pItem = NULL, bool swap = false, uint32* no_space_count = nullptr) const;
|
||||
|
||||
void AddRefundReference(uint32 it);
|
||||
void DeleteRefundReference(uint32 it);
|
||||
@@ -1400,7 +1400,7 @@ class Player : public Unit, public GridObject<Player>
|
||||
|
||||
float GetReputationPriceDiscount(Creature const* creature) const;
|
||||
|
||||
Player* GetTrader() const { return m_trade ? m_trade->GetTrader() : NULL; }
|
||||
Player* GetTrader() const { return m_trade ? m_trade->GetTrader() : nullptr; }
|
||||
TradeData* GetTradeData() const { return m_trade; }
|
||||
void TradeCancel(bool sendback);
|
||||
|
||||
@@ -1456,7 +1456,7 @@ class Player : public Unit, public GridObject<Player>
|
||||
bool CanSeeStartQuest(Quest const* quest);
|
||||
bool CanTakeQuest(Quest const* quest, bool msg);
|
||||
bool CanAddQuest(Quest const* quest, bool msg);
|
||||
bool CanCompleteQuest(uint32 quest_id, const QuestStatusData* q_savedStatus = NULL);
|
||||
bool CanCompleteQuest(uint32 quest_id, const QuestStatusData* q_savedStatus = nullptr);
|
||||
bool CanCompleteRepeatableQuest(Quest const* quest);
|
||||
bool CanRewardQuest(Quest const* quest, bool msg);
|
||||
bool CanRewardQuest(Quest const* quest, uint32 reward, bool msg);
|
||||
@@ -1692,7 +1692,7 @@ class Player : public Unit, public GridObject<Player>
|
||||
Item* GetMItem(uint32 id)
|
||||
{
|
||||
ItemMap::const_iterator itr = mMitems.find(id);
|
||||
return itr != mMitems.end() ? itr->second : NULL;
|
||||
return itr != mMitems.end() ? itr->second : nullptr;
|
||||
}
|
||||
|
||||
void AddMItem(Item* it)
|
||||
@@ -1793,12 +1793,12 @@ class Player : public Unit, public GridObject<Player>
|
||||
SpellCooldowns & GetSpellCooldownMap() { return m_spellCooldowns; }
|
||||
|
||||
void AddSpellMod(SpellModifier* mod, bool apply);
|
||||
bool IsAffectedBySpellmod(SpellInfo const* spellInfo, SpellModifier* mod, Spell* spell = NULL);
|
||||
bool IsAffectedBySpellmod(SpellInfo const* spellInfo, SpellModifier* mod, Spell* spell = nullptr);
|
||||
bool HasSpellMod(SpellModifier* mod, Spell* spell);
|
||||
template <class T> T ApplySpellMod(uint32 spellId, SpellModOp op, T &basevalue, Spell* spell = NULL, bool temporaryPet = false);
|
||||
void RemoveSpellMods(Spell* spell);
|
||||
void RestoreSpellMods(Spell* spell, uint32 ownerAuraId = 0, Aura* aura = NULL);
|
||||
void RestoreAllSpellMods(uint32 ownerAuraId = 0, Aura* aura = NULL);
|
||||
void RestoreSpellMods(Spell* spell, uint32 ownerAuraId = 0, Aura* aura = nullptr);
|
||||
void RestoreAllSpellMods(uint32 ownerAuraId = 0, Aura* aura = nullptr);
|
||||
void DropModCharge(SpellModifier* mod, Spell* spell);
|
||||
void SetSpellModTakingSpell(Spell* spell, bool apply);
|
||||
|
||||
@@ -1911,7 +1911,7 @@ class Player : public Unit, public GridObject<Player>
|
||||
bool IsInSameGroupWith(Player const* p) const;
|
||||
bool IsInSameRaidWith(Player const* p) const { return p == this || (GetGroup() != NULL && GetGroup() == p->GetGroup()); }
|
||||
void UninviteFromGroup();
|
||||
static void RemoveFromGroup(Group* group, uint64 guid, RemoveMethod method = GROUP_REMOVEMETHOD_DEFAULT, uint64 kicker = 0, const char* reason = NULL);
|
||||
static void RemoveFromGroup(Group* group, uint64 guid, RemoveMethod method = GROUP_REMOVEMETHOD_DEFAULT, uint64 kicker = 0, const char* reason = nullptr);
|
||||
void RemoveFromGroup(RemoveMethod method = GROUP_REMOVEMETHOD_DEFAULT) { RemoveFromGroup(GetGroup(), GetGUID(), method); }
|
||||
void SendUpdateToOutOfRangeGroupMembers();
|
||||
|
||||
@@ -2055,7 +2055,7 @@ class Player : public Unit, public GridObject<Player>
|
||||
void UpdateUnderwaterState(Map* m, float x, float y, float z) override;
|
||||
|
||||
void SendMessageToSet(WorldPacket* data, bool self) override { SendMessageToSetInRange(data, GetVisibilityRange(), self, true); } // pussywizard!
|
||||
void SendMessageToSetInRange(WorldPacket* data, float dist, bool self, bool includeMargin = false, Player const* skipped_rcvr = NULL) override; // pussywizard!
|
||||
void SendMessageToSetInRange(WorldPacket* data, float dist, bool self, bool includeMargin = false, Player const* skipped_rcvr = nullptr) override; // pussywizard!
|
||||
void SendMessageToSetInRange_OwnTeam(WorldPacket* data, float dist, bool self); // pussywizard! param includeMargin not needed here
|
||||
void SendMessageToSet(WorldPacket* data, Player const* skipped_rcvr) override { SendMessageToSetInRange(data, GetVisibilityRange(), skipped_rcvr != this, true, skipped_rcvr); } // pussywizard!
|
||||
|
||||
@@ -2167,8 +2167,8 @@ class Player : public Unit, public GridObject<Player>
|
||||
bool RewardHonor(Unit* victim, uint32 groupsize, int32 honor = -1, bool awardXP = true);
|
||||
uint32 GetHonorPoints() const { return GetUInt32Value(PLAYER_FIELD_HONOR_CURRENCY); }
|
||||
uint32 GetArenaPoints() const { return GetUInt32Value(PLAYER_FIELD_ARENA_CURRENCY); }
|
||||
void ModifyHonorPoints(int32 value, SQLTransaction* trans = NULL); //! If trans is specified, honor save query will be added to trans
|
||||
void ModifyArenaPoints(int32 value, SQLTransaction* trans = NULL); //! If trans is specified, arena point save query will be added to trans
|
||||
void ModifyHonorPoints(int32 value, SQLTransaction* trans = nullptr); //! If trans is specified, honor save query will be added to trans
|
||||
void ModifyArenaPoints(int32 value, SQLTransaction* trans = nullptr); //! If trans is specified, arena point save query will be added to trans
|
||||
uint32 GetMaxPersonalArenaRatingRequirement(uint32 minarenaslot) const;
|
||||
void SetHonorPoints(uint32 value);
|
||||
void SetArenaPoints(uint32 value);
|
||||
@@ -2328,7 +2328,7 @@ class Player : public Unit, public GridObject<Player>
|
||||
|
||||
TeamId GetBgTeamId() const { return m_bgData.bgTeamId != TEAM_NEUTRAL ? m_bgData.bgTeamId : GetTeamId(); }
|
||||
|
||||
void LeaveBattleground(Battleground* bg = NULL);
|
||||
void LeaveBattleground(Battleground* bg = nullptr);
|
||||
bool CanJoinToBattleground() const;
|
||||
bool CanReportAfkDueToLimit();
|
||||
void ReportedAfkBy(Player* reporter);
|
||||
@@ -2555,7 +2555,7 @@ class Player : public Unit, public GridObject<Player>
|
||||
void ResetAchievements();
|
||||
void CheckAllAchievementCriteria();
|
||||
void ResetAchievementCriteria(AchievementCriteriaCondition condition, uint32 value, bool evenIfCriteriaComplete = false);
|
||||
void UpdateAchievementCriteria(AchievementCriteriaTypes type, uint32 miscValue1 = 0, uint32 miscValue2 = 0, Unit* unit = NULL);
|
||||
void UpdateAchievementCriteria(AchievementCriteriaTypes type, uint32 miscValue1 = 0, uint32 miscValue2 = 0, Unit* unit = nullptr);
|
||||
void StartTimedAchievement(AchievementCriteriaTimedTypes type, uint32 entry, uint32 timeLost = 0);
|
||||
void RemoveTimedAchievement(AchievementCriteriaTimedTypes type, uint32 entry);
|
||||
void CompletedAchievement(AchievementEntry const* entry);
|
||||
|
||||
Reference in New Issue
Block a user