mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-15 23:20:36 +01:00
Core/Globals: throw some RAII into ObjectMgr, and load templates into vectors
Ref #14274
(cherry picked from commit b64c504314)
This commit is contained in:
@@ -770,9 +770,8 @@ void InstanceScript::UpdateEncounterState(EncounterCreditType type, uint32 credi
|
||||
|
||||
uint32 dungeonId = 0;
|
||||
|
||||
for (DungeonEncounterList::const_iterator itr = encounters->begin(); itr != encounters->end(); ++itr)
|
||||
for (auto const& encounter : *encounters)
|
||||
{
|
||||
DungeonEncounter const* encounter = *itr;
|
||||
if (encounter->creditType == type && encounter->creditEntry == creditEntry)
|
||||
{
|
||||
completedEncounters |= 1 << encounter->dbcEntry->Bit;
|
||||
@@ -789,15 +788,19 @@ void InstanceScript::UpdateEncounterState(EncounterCreditType type, uint32 credi
|
||||
if (dungeonId)
|
||||
{
|
||||
Map::PlayerList const& players = instance->GetPlayers();
|
||||
for (Map::PlayerList::const_iterator i = players.begin(); i != players.end(); ++i)
|
||||
for (auto const& ref : players)
|
||||
{
|
||||
if (Player* player = i->GetSource())
|
||||
if (Player* player = ref.GetSource())
|
||||
{
|
||||
if (Group* grp = player->GetGroup())
|
||||
{
|
||||
if (grp->isLFGGroup())
|
||||
{
|
||||
sLFGMgr->FinishDungeon(grp->GetGUID(), dungeonId, instance);
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user