diff options
| author | Nay <dnpd.dd@gmail.com> | 2012-09-03 15:51:34 +0100 |
|---|---|---|
| committer | Nay <dnpd.dd@gmail.com> | 2012-09-03 15:51:34 +0100 |
| commit | c7fed98b9ddef32b7c17d6022435b5bf8c4fa3f5 (patch) | |
| tree | 3ae3947ff14a14208f6ece4e635f0b5641c8c9d3 /src/server/game/AI | |
| parent | ffe8c75f17aa4c4059771265dd408055cb3c4e52 (diff) | |
| parent | 0db5573d4de436cf14c9f6d113a28800fa278c2c (diff) | |
Merge remote-tracking branch 'origin/master' into mmaps
Conflicts:
dep/PackageList.txt
Diffstat (limited to 'src/server/game/AI')
| -rw-r--r-- | src/server/game/AI/ScriptedAI/ScriptedCreature.h | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/server/game/AI/ScriptedAI/ScriptedCreature.h b/src/server/game/AI/ScriptedAI/ScriptedCreature.h index ba0a94d2590..aa46d555b7d 100644 --- a/src/server/game/AI/ScriptedAI/ScriptedCreature.h +++ b/src/server/game/AI/ScriptedAI/ScriptedCreature.h @@ -41,8 +41,10 @@ class SummonList : public std::list<uint64> template <class Predicate> void DoAction(int32 info, Predicate& predicate, uint16 max = 0) { - Trinity::Containers::RandomResizeList<uint64, Predicate>(*this, predicate, max); - for (iterator i = begin(); i != end(); ) + // We need to use a copy of SummonList here, otherwise original SummonList would be modified + std::list<uint64> listCopy = *this; + Trinity::Containers::RandomResizeList<uint64, Predicate>(listCopy, predicate, max); + for (iterator i = listCopy.begin(); i != listCopy.end(); ) { Creature* summon = Unit::GetCreature(*me, *i++); if (summon && summon->IsAIEnabled) |
