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:
Kitzunu
2020-08-31 11:55:09 +02:00
committed by GitHub
parent 38903b5dfb
commit 1f89282b22
325 changed files with 2348 additions and 2348 deletions

View File

@@ -232,7 +232,7 @@ LootTemplate const* LootStore::GetLootFor(uint32 loot_id) const
LootTemplateMap::const_iterator tab = m_LootTemplates.find(loot_id);
if (tab == m_LootTemplates.end())
return NULL;
return nullptr;
return tab->second;
}
@@ -242,7 +242,7 @@ LootTemplate* LootStore::GetLootForConditionFill(uint32 loot_id) const
LootTemplateMap::const_iterator tab = m_LootTemplates.find(loot_id);
if (tab == m_LootTemplates.end())
return NULL;
return nullptr;
return tab->second;
}
@@ -481,7 +481,7 @@ bool Loot::FillLoot(uint32 lootId, LootStore const& store, Player* lootOwner, bo
{
roundRobinPlayer = lootOwner->GetGUID();
for (GroupReference* itr = group->GetFirstMember(); itr != NULL; itr = itr->next())
for (GroupReference* itr = group->GetFirstMember(); itr != nullptr; itr = itr->next())
if (Player* player = itr->GetSource()) // should actually be looted object instead of lootOwner but looter has to be really close so doesnt really matter
if (player->IsInMap(lootOwner)) // pussywizard: multithreading crashfix
FillNotNormalLootFor(player, player->IsAtGroupRewardDistance(lootOwner));
@@ -522,7 +522,7 @@ void Loot::FillNotNormalLootFor(Player* player, bool presentAtLooting)
// Process currency items
uint32 max_slot = GetMaxSlotInLootFor(player);
LootItem const* item = NULL;
LootItem const* item = nullptr;
uint32 itemsSize = uint32(items.size());
for (uint32 i = 0; i < max_slot; ++i)
{
@@ -554,7 +554,7 @@ QuestItemList* Loot::FillFFALoot(Player* player)
if (ql->empty())
{
delete ql;
return NULL;
return nullptr;
}
PlayerFFAItems[player->GetGUIDLow()] = ql;
@@ -564,7 +564,7 @@ QuestItemList* Loot::FillFFALoot(Player* player)
QuestItemList* Loot::FillQuestLoot(Player* player)
{
if (items.size() == MAX_NR_LOOT_ITEMS)
return NULL;
return nullptr;
QuestItemList* ql = new QuestItemList();
@@ -592,7 +592,7 @@ QuestItemList* Loot::FillQuestLoot(Player* player)
if (ql->empty())
{
delete ql;
return NULL;
return nullptr;
}
PlayerQuestItems[player->GetGUIDLow()] = ql;
@@ -624,7 +624,7 @@ QuestItemList* Loot::FillNonQuestNonFFAConditionalLoot(Player* player, bool pres
if (ql->empty())
{
delete ql;
return NULL;
return nullptr;
}
PlayerNonQuestNonFFAConditionalItems[player->GetGUIDLow()] = ql;
@@ -713,7 +713,7 @@ void Loot::generateMoneyLoot(uint32 minAmount, uint32 maxAmount)
LootItem* Loot::LootItemInSlot(uint32 lootSlot, Player* player, QuestItem* *qitem, QuestItem* *ffaitem, QuestItem* *conditem)
{
LootItem* item = NULL;
LootItem* item = nullptr;
bool is_looted = true;
if (lootSlot >= items.size())
{
@@ -726,7 +726,7 @@ LootItem* Loot::LootItemInSlot(uint32 lootSlot, Player* player, QuestItem* *qite
*qitem = qitem2;
item = &quest_items[qitem2->index];
if (item->follow_loot_rules && !item->AllowedForPlayer(player)) // pussywizard: such items (follow_loot_rules) are added to every player, but not everyone is allowed, check it here
return NULL;
return nullptr;
is_looted = qitem2->is_looted;
}
}
@@ -771,7 +771,7 @@ LootItem* Loot::LootItemInSlot(uint32 lootSlot, Player* player, QuestItem* *qite
}
if (is_looted)
return NULL;
return nullptr;
return item;
}
@@ -1143,7 +1143,7 @@ LootStoreItem const* LootTemplate::LootGroup::Roll(Loot& loot, Player const *pla
if (!possibleLoot.empty()) // If nothing selected yet - an item is taken from equal-chanced part
return acore::Containers::SelectRandomContainerElement(possibleLoot);
return NULL; // Empty drop from the group
return nullptr; // Empty drop from the group
}
// True if group includes at least 1 quest drop entry
@@ -1277,7 +1277,7 @@ void LootTemplate::AddEntry(LootStoreItem* item)
if (item->groupid > 0 && item->reference == 0) // Group
{
if (item->groupid >= Groups.size())
Groups.resize(item->groupid, NULL); // Adds new group the the loot template if needed
Groups.resize(item->groupid, nullptr); // Adds new group the the loot template if needed
if (!Groups[item->groupid - 1])
Groups[item->groupid - 1] = new LootGroup();