mirror of
https://github.com/mod-playerbots/azerothcore-wotlk.git
synced 2026-01-13 01:08:35 +00:00
chore(core): cleanup code p3 (#16073)
* Update MMapMgr.cpp * Update UpdateFetcher.cpp * Update AuctionHouseMgr.cpp * Update AuctionHouseMgr.h * Update BattlegroundAV.cpp * Update ChannelMgr.cpp * Update ThreatMgr.h * Update Player.h * Update PlayerSettings.cpp * Update ObjectMgr.cpp * Update Guild.cpp * Update Guild.h * Update Map.cpp * Update World.cpp * Update boss_nefarian.cpp * Update boss_prince_malchezaar.cpp * Update boss_venoxis.cpp * Update zone_elwynn_forest.cpp * Update zulfarrak.cpp * Update boss_novos.cpp
This commit is contained in:
@@ -253,7 +253,7 @@ namespace MMAP
|
||||
|
||||
// unload all tiles from given map
|
||||
MMapData* mmap = itr->second;
|
||||
for (auto i : mmap->loadedTileRefs)
|
||||
for (auto& i : mmap->loadedTileRefs)
|
||||
{
|
||||
uint32 x = (i.first >> 16);
|
||||
uint32 y = (i.first & 0x0000FFFF);
|
||||
|
||||
@@ -252,7 +252,7 @@ UpdateResult UpdateFetcher::Update(bool const redundancyChecks,
|
||||
|
||||
// Fill hash to name cache
|
||||
HashToFileNameStorage hashToName;
|
||||
for (auto entry : applied)
|
||||
for (auto& entry : applied)
|
||||
hashToName.insert(std::make_pair(entry.second.hash, entry.first));
|
||||
|
||||
size_t importedUpdates = 0;
|
||||
|
||||
@@ -37,7 +37,7 @@ constexpr auto AH_MINIMUM_DEPOSIT = 100;
|
||||
// Proof of concept, we should shift the info we're obtaining in here into AuctionEntry probably
|
||||
static bool SortAuction(AuctionEntry* left, AuctionEntry* right, AuctionSortOrderVector& sortOrder, Player* player, bool checkMinBidBuyout)
|
||||
{
|
||||
for (auto thisOrder : sortOrder)
|
||||
for (auto& thisOrder : sortOrder)
|
||||
{
|
||||
switch (thisOrder.sortOrder)
|
||||
{
|
||||
@@ -908,7 +908,7 @@ bool AuctionHouseObject::BuildListAuctionItems(WorldPacket& data, Player* player
|
||||
}
|
||||
}
|
||||
|
||||
for (auto auction : auctionShortlist)
|
||||
for (auto& auction : auctionShortlist)
|
||||
{
|
||||
// Add the item if no search term or if entered search term was found
|
||||
if (count < 50 && totalcount >= listfrom)
|
||||
|
||||
@@ -133,7 +133,7 @@ public:
|
||||
AuctionHouseObject() { _next = _auctionsMap.begin(); }
|
||||
~AuctionHouseObject()
|
||||
{
|
||||
for (auto & itr : _auctionsMap)
|
||||
for (auto& itr : _auctionsMap)
|
||||
delete itr.second;
|
||||
}
|
||||
|
||||
|
||||
@@ -1579,7 +1579,7 @@ void BattlegroundAV::ResetBGSubclass()
|
||||
|
||||
bool BattlegroundAV::IsBothMinesControlledByTeam(TeamId teamId) const
|
||||
{
|
||||
for (auto mine : m_Mine_Owner)
|
||||
for (auto& mine : m_Mine_Owner)
|
||||
if (mine != teamId)
|
||||
return false;
|
||||
|
||||
|
||||
@@ -106,7 +106,7 @@ void ChannelMgr::LoadChannels()
|
||||
++count;
|
||||
} while (result->NextRow());
|
||||
|
||||
for (auto pair : toDelete)
|
||||
for (auto& pair : toDelete)
|
||||
{
|
||||
CharacterDatabasePreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_CHANNEL);
|
||||
stmt->SetData(0, pair.first);
|
||||
|
||||
@@ -259,7 +259,7 @@ public:
|
||||
if (threatList.empty())
|
||||
return;
|
||||
|
||||
for (auto ref : threatList)
|
||||
for (auto& ref : threatList)
|
||||
{
|
||||
if (predicate(ref->getTarget()))
|
||||
{
|
||||
|
||||
@@ -1801,7 +1801,7 @@ public:
|
||||
{
|
||||
Unit::SetPvP(state);
|
||||
if (!m_Controlled.empty())
|
||||
for (auto itr : m_Controlled)
|
||||
for (auto& itr : m_Controlled)
|
||||
itr->SetPvP(state);
|
||||
}
|
||||
void UpdatePvP(bool state, bool _override = false);
|
||||
|
||||
@@ -48,7 +48,7 @@ void Player::_LoadCharacterSettings(PreparedQueryResult result)
|
||||
|
||||
uint32 count = 0;
|
||||
|
||||
for (auto token : tokens)
|
||||
for (auto& token : tokens)
|
||||
{
|
||||
if (token.empty())
|
||||
{
|
||||
@@ -95,11 +95,11 @@ void Player::_SavePlayerSettings(CharacterDatabaseTransaction trans)
|
||||
return;
|
||||
}
|
||||
|
||||
for (auto itr : m_charSettingsMap)
|
||||
for (auto& itr : m_charSettingsMap)
|
||||
{
|
||||
std::ostringstream data;
|
||||
|
||||
for (auto setting : itr.second)
|
||||
for (auto& setting : itr.second)
|
||||
{
|
||||
data << setting.value << ' ';
|
||||
}
|
||||
|
||||
@@ -948,7 +948,7 @@ void ObjectMgr::LoadCreatureCustomIDs()
|
||||
std::string stringCreatureIds = sConfigMgr->GetOption<std::string>("Creatures.CustomIDs", "");
|
||||
std::vector<std::string_view> CustomCreatures = Acore::Tokenize(stringCreatureIds, ',', false);
|
||||
|
||||
for (auto itr : CustomCreatures)
|
||||
for (auto& itr : CustomCreatures)
|
||||
{
|
||||
_creatureCustomIDsStore.push_back(Acore::StringTo<uint32>(itr).value());
|
||||
}
|
||||
@@ -1296,7 +1296,7 @@ void ObjectMgr::CheckCreatureTemplate(CreatureTemplate const* cInfo)
|
||||
const_cast<CreatureTemplate*>(cInfo)->DamageModifier *= Creature::_GetDamageMod(cInfo->rank);
|
||||
|
||||
// Hack for modules
|
||||
for (auto itr : _creatureCustomIDsStore)
|
||||
for (auto& itr : _creatureCustomIDsStore)
|
||||
{
|
||||
if (cInfo->Entry == itr)
|
||||
return;
|
||||
|
||||
@@ -1388,7 +1388,7 @@ void Guild::HandleSetRankInfo(WorldSession* session, uint8 rankId, std::string_v
|
||||
rankInfo->SetRights(rights);
|
||||
_SetRankBankMoneyPerDay(rankId, moneyPerDay);
|
||||
|
||||
for (auto rightsAndSlot : rightsAndSlots)
|
||||
for (auto& rightsAndSlot : rightsAndSlots)
|
||||
_SetRankBankTabRightsAndSlots(rankId, rightsAndSlot);
|
||||
|
||||
_BroadcastEvent(GE_RANK_UPDATED, ObjectGuid::Empty, std::to_string(rankId), rankInfo->GetName(), std::to_string(m_ranks.size()));
|
||||
@@ -2382,7 +2382,7 @@ void Guild::_CreateNewBankTab()
|
||||
trans->Append(stmt);
|
||||
|
||||
++tabId;
|
||||
for (auto & m_rank : m_ranks)
|
||||
for (auto& m_rank : m_ranks)
|
||||
m_rank.CreateMissingTabsIfNeeded(tabId, trans, false);
|
||||
|
||||
CharacterDatabase.CommitTransaction(trans);
|
||||
|
||||
@@ -393,7 +393,7 @@ public: // pussywizard: public class Member
|
||||
}
|
||||
inline Member* GetMember(std::string_view name)
|
||||
{
|
||||
for (auto & m_member : m_members)
|
||||
for (auto& m_member : m_members)
|
||||
if (m_member.second.GetName() == name)
|
||||
return &m_member.second;
|
||||
|
||||
|
||||
@@ -3820,7 +3820,7 @@ void Map::DoForAllPlayers(std::function<void(Player*)> exec)
|
||||
bool Map::CanReachPositionAndGetValidCoords(WorldObject const* source, PathGenerator *path, float &destX, float &destY, float &destZ, bool failOnCollision, bool failOnSlopes) const
|
||||
{
|
||||
G3D::Vector3 prevPath = path->GetStartPosition();
|
||||
for (auto & vector : path->GetPath())
|
||||
for (auto& vector : path->GetPath())
|
||||
{
|
||||
float x = vector.x;
|
||||
float y = vector.y;
|
||||
|
||||
@@ -1560,7 +1560,7 @@ void World::SetInitialWorldSettings()
|
||||
sIPLocation->Load();
|
||||
|
||||
std::vector<uint32> mapIds;
|
||||
for (auto const map : sMapStore)
|
||||
for (auto const& map : sMapStore)
|
||||
{
|
||||
mapIds.emplace_back(map->MapID);
|
||||
}
|
||||
|
||||
@@ -1243,7 +1243,7 @@ class spell_shadowblink : public SpellScript
|
||||
return;
|
||||
}
|
||||
|
||||
for (auto itr : spellPos)
|
||||
for (auto& itr : spellPos)
|
||||
{
|
||||
float distTarget = target->GetDistance2d(itr.second.m_positionX, itr.second.m_positionY);
|
||||
if (distTarget <= 30.f)
|
||||
|
||||
@@ -248,7 +248,7 @@ struct boss_malchezaar : public BossAI
|
||||
|
||||
void EnfeebleResetHealth()
|
||||
{
|
||||
for (auto targets : _enfeebleTargets)
|
||||
for (auto& targets : _enfeebleTargets)
|
||||
{
|
||||
if (Unit* target = ObjectAccessor::GetUnit(*me, targets.first))
|
||||
{
|
||||
|
||||
@@ -131,7 +131,7 @@ public:
|
||||
|
||||
if (!cobraList.empty())
|
||||
{
|
||||
for (auto cobras : cobraList)
|
||||
for (auto& cobras : cobraList)
|
||||
{
|
||||
cobras->SetInCombatWithZone();
|
||||
}
|
||||
|
||||
@@ -101,7 +101,7 @@ struct npc_cameron : public ScriptedAI
|
||||
Acore::Containers::RandomShuffle(MovePosPositions);
|
||||
|
||||
// first we break formation because children will need to move on their own now
|
||||
for (auto guid : _childrenGUIDs)
|
||||
for (auto& guid : _childrenGUIDs)
|
||||
if (Creature* child = ObjectAccessor::GetCreature(*me, guid))
|
||||
if (child->GetFormation())
|
||||
child->GetFormation()->RemoveMember(child);
|
||||
@@ -228,7 +228,7 @@ struct npc_cameron : public ScriptedAI
|
||||
|
||||
// If Formation was disbanded, remake.
|
||||
if (!me->GetFormation()->IsFormed())
|
||||
for (auto guid : _childrenGUIDs)
|
||||
for (auto& guid : _childrenGUIDs)
|
||||
if (Creature* child = ObjectAccessor::GetCreature(*me, guid))
|
||||
child->SearchFormation();
|
||||
|
||||
|
||||
@@ -573,7 +573,7 @@ public:
|
||||
|
||||
if (_summonAddsTimer <= diff)
|
||||
{
|
||||
for (auto itr : shadowpriestSezzizAdds[_summmonAddsCount])
|
||||
for (auto& itr : shadowpriestSezzizAdds[_summmonAddsCount])
|
||||
{
|
||||
if (Creature* add = me->SummonCreature(itr.first, itr.second, TEMPSUMMON_DEAD_DESPAWN, 10 * IN_MILLISECONDS))
|
||||
{
|
||||
|
||||
@@ -132,7 +132,7 @@ public:
|
||||
me->CastSpell(me, SPELL_ARCANE_FIELD, true);
|
||||
me->CastSpell(me, SPELL_DESPAWN_CRYSTAL_HANDLER, true);
|
||||
|
||||
for (auto itr : npcSummon)
|
||||
for (auto& itr : npcSummon)
|
||||
{
|
||||
uint32 summonEntry;
|
||||
Position summonPos;
|
||||
|
||||
Reference in New Issue
Block a user