TrinityCore/TrinityCore — pull request #7613 by Elron103 (2012-09-01 22:29:22+00:00)
Title: Core/Scripting: Fix DoAction function of SummonList incorrectly removing entries in SummonList

## Description

Currently there is an issue affecting all scripts using the DoAction function of SummonLists.

Responsible code:
https://github.com/TrinityCore/TrinityCore/blob/master/src/server/game/AI/ScriptedAI/ScriptedCreature.h#L42

The DoAction function passes the actual SummonList directly to the function "Trinity::Containers::RandomResizeList". But this function assumes, that the list, which is passed over to it, is to be modified by the function. So it uses the list as a reference and erases all entries, which do not fit to the requirements given in the predicate.

This is also the reason, why we may not pass "this" (so the SummonList itsself) to that function, since it is also being modified in there. The result is, that we will have an invalidated SummonList and entries are being removed incorrectly.

### Repdroduction
I noticed that issue in the Anub'Arak encounter in Trial of the Crusaders. It uses the DoAction function in order to make the Nerubian Burrowers cast something. But since all entries except those creatures are erased from the SummonList, all other creatures will not despawn on wipe or on bosskill, since the entries were erased due to that DoAction call before.

## Revisions

Trinity: https://github.com/TrinityCore/TrinityCore/commit/936c62ef4cfe85b04f689d08696a29a792815c2a
Database: TDB rev. 48