mirror of
https://github.com/mod-playerbots/azerothcore-wotlk.git
synced 2026-02-16 08:46:09 +00:00
chore(Apps/Codestyle): add new codestyle checks for pointers and range loops (#19841)
* chore(Apps/Codestyle): add new codestyle checks for pointers and range loops * revert a typo
This commit is contained in:
@@ -303,7 +303,7 @@ public:
|
||||
bool doReset = false;
|
||||
if (resetTimer > 0)
|
||||
{
|
||||
for (const auto& sum : summons)
|
||||
for (auto const& sum : summons)
|
||||
{
|
||||
if (Creature* creature = ObjectAccessor::GetCreature(*me, sum))
|
||||
{
|
||||
|
||||
@@ -471,7 +471,7 @@ public:
|
||||
SetData(TYPE_RING_OF_LAW, NOT_STARTED);
|
||||
break;
|
||||
case DONE:
|
||||
for (const auto& itr : ArenaSpectators)
|
||||
for (auto const& itr : ArenaSpectators)
|
||||
{
|
||||
if (Creature* spectator = instance->GetCreature(itr))
|
||||
{
|
||||
|
||||
@@ -83,7 +83,7 @@ public:
|
||||
}
|
||||
|
||||
GetCreatureListWithEntryInGrid(nearbyWhelps, me, NPC_ROOKERY_WHELP, RANGE_WHELP_CALL_HELP);
|
||||
for (const auto& whelp : nearbyWhelps)
|
||||
for (auto const& whelp : nearbyWhelps)
|
||||
{
|
||||
if (!whelp->IsInCombat())
|
||||
{
|
||||
@@ -106,7 +106,7 @@ public:
|
||||
minDist = 50;
|
||||
tempDist = 50;
|
||||
me->GetGameObjectListWithEntryInGrid(nearbyEggs, GO_ROOKERY_EGG, 40);
|
||||
for (const auto& egg : nearbyEggs)
|
||||
for (auto const& egg : nearbyEggs)
|
||||
{
|
||||
if (egg->isSpawned() && egg->getLootState() == GO_READY)
|
||||
{
|
||||
|
||||
@@ -401,14 +401,14 @@ public:
|
||||
pile->SetLootState(GO_READY);
|
||||
pile->Respawn();
|
||||
}
|
||||
for (const auto& circleGUID : go_urokOgreCirles)
|
||||
for (auto const& circleGUID : go_urokOgreCirles)
|
||||
{
|
||||
if (GameObject* circle = instance->GetGameObject(circleGUID))
|
||||
{
|
||||
circle->Delete();
|
||||
}
|
||||
}
|
||||
for (const auto& mobGUID : UrokMobs)
|
||||
for (auto const& mobGUID : UrokMobs)
|
||||
{
|
||||
if (Creature* mob = instance->GetCreature(mobGUID))
|
||||
{
|
||||
|
||||
@@ -120,7 +120,7 @@ public:
|
||||
immol->GetAI()->SetData(1, 1);
|
||||
immol->RemoveUnitFlag(UNIT_FLAG_NON_ATTACKABLE);
|
||||
}
|
||||
for (const auto& guid : HighborneSummoners)
|
||||
for (auto const& guid : HighborneSummoners)
|
||||
{
|
||||
if (Creature* summoner = instance->GetCreature(guid))
|
||||
{
|
||||
|
||||
@@ -386,7 +386,7 @@ struct boss_cthun : public BossAI
|
||||
}, 500ms);
|
||||
|
||||
//Spawn flesh tentacle
|
||||
for (const auto& position : FleshTentaclePos)
|
||||
for (auto const& position : FleshTentaclePos)
|
||||
me->SummonCreature(NPC_FLESH_TENTACLE, position, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 5000);
|
||||
|
||||
ScheduleTasks();
|
||||
@@ -501,7 +501,7 @@ struct boss_cthun : public BossAI
|
||||
me->RemoveAurasDueToSpell(SPELL_PURPLE_COLORATION);
|
||||
DoCastSelf(SPELL_CARAPACE_CTHUN, true);
|
||||
//Spawn flesh tentacle
|
||||
for (const auto& position : FleshTentaclePos)
|
||||
for (auto const& position : FleshTentaclePos)
|
||||
me->SummonCreature(NPC_FLESH_TENTACLE, position, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 5000);
|
||||
});
|
||||
}
|
||||
|
||||
@@ -159,7 +159,7 @@ public:
|
||||
return false;
|
||||
|
||||
Map::PlayerList const& pList = me->GetMap()->GetPlayers();
|
||||
for (const auto& itr : pList)
|
||||
for (auto const& itr : pList)
|
||||
{
|
||||
Player* player = itr.GetSource();
|
||||
if (!player || !player->IsAlive())
|
||||
|
||||
@@ -387,7 +387,7 @@ public:
|
||||
{
|
||||
bool checklife = false;
|
||||
bool checkdead = false;
|
||||
for (const auto& i : PlayerList)
|
||||
for (auto const& i : PlayerList)
|
||||
{
|
||||
Player* player = i.GetSource();
|
||||
if (player->IsAlive() &&
|
||||
|
||||
@@ -228,7 +228,7 @@ public:
|
||||
case EVENT_SAFETY_DANCE:
|
||||
{
|
||||
Map::PlayerList const& pList = me->GetMap()->GetPlayers();
|
||||
for (const auto& itr : pList)
|
||||
for (auto const& itr : pList)
|
||||
{
|
||||
if (IsInRoom(itr.GetSource()) && !itr.GetSource()->IsAlive())
|
||||
{
|
||||
|
||||
@@ -142,7 +142,7 @@ public:
|
||||
if (PlList.IsEmpty())
|
||||
return;
|
||||
|
||||
for (const auto& i : PlList)
|
||||
for (auto const& i : PlList)
|
||||
{
|
||||
if (Player* player = i.GetSource())
|
||||
{
|
||||
@@ -400,7 +400,7 @@ public:
|
||||
case EVENT_HUNDRED_CLUB:
|
||||
{
|
||||
Map::PlayerList const& pList = me->GetMap()->GetPlayers();
|
||||
for (const auto& itr : pList)
|
||||
for (auto const& itr : pList)
|
||||
{
|
||||
if (itr.GetSource()->GetResistance(SPELL_SCHOOL_FROST) > 100 && pInstance)
|
||||
{
|
||||
|
||||
@@ -671,7 +671,7 @@ class spell_hun_readiness : public SpellScript
|
||||
std::set<std::pair<uint32, bool>> spellsToRemove;
|
||||
std::set<uint32> categoriesToRemove;
|
||||
|
||||
for (const auto& [spellId, cooldown] : cooldowns)
|
||||
for (auto const& [spellId, cooldown] : cooldowns)
|
||||
{
|
||||
SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(spellId);
|
||||
if (spellInfo
|
||||
@@ -689,9 +689,9 @@ class spell_hun_readiness : public SpellScript
|
||||
}
|
||||
|
||||
// we can't remove spell cooldowns while iterating.
|
||||
for (const auto& [spellId, sendToClient] : spellsToRemove)
|
||||
for (auto const& [spellId, sendToClient] : spellsToRemove)
|
||||
caster->RemoveSpellCooldown(spellId, sendToClient);
|
||||
for (const auto& category : categoriesToRemove)
|
||||
for (auto const& category : categoriesToRemove)
|
||||
caster->RemoveCategoryCooldown(category);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user