mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-30 05:43:12 +01:00
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:
@@ -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]);
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user