mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-20 17:27:36 +01:00
Scripts/VioletHold: Fix crash
Fix crash in Violet Hold happening when crystals were activated without killing trash mobs. Crash added incba6515acbandf4531c5a58. Closes #14629 (cherry picked from commit09aed25659)
This commit is contained in:
@@ -794,9 +794,11 @@ public:
|
||||
trigger->CastSpell(trigger, spellInfoLightning, true, 0, 0, trigger->GetGUID());
|
||||
|
||||
// Kill all mobs registered with SetGuidData(ADD_TRASH_MOB)
|
||||
for (GuidSet::const_iterator itr = trashMobs.begin(); itr != trashMobs.end(); ++itr)
|
||||
for (GuidSet::const_iterator itr = trashMobs.begin(); itr != trashMobs.end();)
|
||||
{
|
||||
Creature* creature = instance->GetCreature(*itr);
|
||||
// Increment the iterator before killing the creature because the kill will remove itr from trashMobs
|
||||
++itr;
|
||||
if (creature && creature->IsAlive())
|
||||
trigger->Kill(creature);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user