diff --git a/src/game/Loot/LootMgr.cpp b/src/game/Loot/LootMgr.cpp index 95b0e39255..74358ddf2a 100644 --- a/src/game/Loot/LootMgr.cpp +++ b/src/game/Loot/LootMgr.cpp @@ -2466,10 +2466,10 @@ LootStoreItem const* LootTemplate::LootGroup::Roll(Loot const& loot, Player cons // True if group includes at least 1 quest drop entry bool LootTemplate::LootGroup::HasQuestDrop() const { - for (auto i : ExplicitlyChanced) + for (auto const& i : ExplicitlyChanced) if (i.needs_quest) return true; - for (auto i : EqualChanced) + for (auto const& i : EqualChanced) if (i.needs_quest) return true; return false; @@ -2478,10 +2478,10 @@ bool LootTemplate::LootGroup::HasQuestDrop() const // True if group includes at least 1 quest drop entry for active quests of the player bool LootTemplate::LootGroup::HasQuestDropForPlayer(Player const* player) const { - for (auto i : ExplicitlyChanced) + for (auto const& i : ExplicitlyChanced) if (player->HasQuestForItem(i.itemid)) return true; - for (auto i : EqualChanced) + for (auto const& i : EqualChanced) if (player->HasQuestForItem(i.itemid)) return true; return false; @@ -2514,7 +2514,7 @@ float LootTemplate::LootGroup::RawTotalChance() const { float result = 0; - for (auto i : ExplicitlyChanced) + for (auto const& i : ExplicitlyChanced) if (!i.needs_quest) result += i.chance; @@ -2594,7 +2594,7 @@ void LootTemplate::Process(Loot& loot, Player const* lootOwner, LootStore const& } // Rolling non-grouped items - for (auto Entrie : Entries) + for (auto const& Entrie : Entries) { // Check condition if (Entrie.conditionId && lootOwner && !PlayerOrGroupFulfilsCondition(loot, lootOwner, Entrie.conditionId)) @@ -2618,7 +2618,7 @@ void LootTemplate::Process(Loot& loot, Player const* lootOwner, LootStore const& } // Now processing groups - for (const auto& Group : Groups) + for (auto const& Group : Groups) Group.Process(loot, lootOwner, store, rate); } @@ -2632,7 +2632,7 @@ bool LootTemplate::HasQuestDrop(LootTemplateMap const& store, uint8 groupId) con return Groups[groupId - 1].HasQuestDrop(); } - for (auto Entrie : Entries) + for (auto const& Entrie : Entries) { if (Entrie.mincountOrRef < 0) // References { @@ -2647,7 +2647,7 @@ bool LootTemplate::HasQuestDrop(LootTemplateMap const& store, uint8 groupId) con } // Now processing groups - for (const auto& Group : Groups) + for (auto const& Group : Groups) if (Group.HasQuestDrop()) return true; @@ -2665,7 +2665,7 @@ bool LootTemplate::HasQuestDropForPlayer(LootTemplateMap const& store, Player co } // Checking non-grouped entries - for (auto Entrie : Entries) + for (auto const& Entrie : Entries) { if (Entrie.mincountOrRef < 0) // References processing { @@ -2680,7 +2680,7 @@ bool LootTemplate::HasQuestDropForPlayer(LootTemplateMap const& store, Player co } // Now checking groups - for (const auto& Group : Groups) + for (auto const& Group : Groups) if (Group.HasQuestDropForPlayer(player)) return true;