Scripts/VioletHold: Fix crash in Xevozz boss fight

Fix crash happening during Xevozz boss fight caused by passing a local list by reference to a lambda expression
Closes #15345
This commit is contained in:
jackpoz
2015-08-24 14:52:03 +02:00
parent 405f823f68
commit f50df72820

View File

@@ -155,19 +155,16 @@ class boss_xevozz : public CreatureScript
std::list<uint8> summonSpells = { 0, 1, 2 };
auto it = summonSpells.begin();
std::advance(it, urand(0, summonSpells.size() - 1));
DoCast(me, EtherealSphereSummonSpells[*it]);
it = summonSpells.erase(it);
uint8 spell = Trinity::Containers::SelectRandomContainerElement(summonSpells);
DoCast(me, EtherealSphereSummonSpells[spell]);
summonSpells.remove(spell);
if (IsHeroic())
{
task.Schedule(Milliseconds(2500), [this, &it, &summonSpells](TaskContext /*task*/)
spell = Trinity::Containers::SelectRandomContainerElement(summonSpells);
task.Schedule(Milliseconds(2500), [this, spell](TaskContext /*task*/)
{
it = summonSpells.begin();
std::advance(it, urand(0, summonSpells.size() - 1));
DoCast(me, EtherealSphereHeroicSummonSpells[*it]);
it = summonSpells.erase(it);
DoCast(me, EtherealSphereHeroicSummonSpells[spell]);
});
}