diff options
author | maximius <none@none> | 2009-11-23 13:57:42 -0800 |
---|---|---|
committer | maximius <none@none> | 2009-11-23 13:57:42 -0800 |
commit | 11f574b12e6e299169e2fa8b979b92a89184397f (patch) | |
tree | 91cbdecfce884df7075beaf1ad4502a5fd1f1a3a /src/game/LootMgr.cpp | |
parent | 75a500218dda8156db7a7a8262f06fe21d936def (diff) |
*Fix a crash due to an invalidated iterator. Closes #420
--HG--
branch : trunk
Diffstat (limited to 'src/game/LootMgr.cpp')
-rw-r--r-- | src/game/LootMgr.cpp | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/src/game/LootMgr.cpp b/src/game/LootMgr.cpp index b85afa18d66..d62daab09f7 100644 --- a/src/game/LootMgr.cpp +++ b/src/game/LootMgr.cpp @@ -882,7 +882,7 @@ void LootTemplate::LootGroup::Process(Loot& loot, uint16 lootMode) const itemSource = 1; float Roll = rand_chance(); // check each explicitly chanced entry in the template and modify its chance based on quality - for (itr = ExplicitPossibleDrops.begin(); itr != ExplicitPossibleDrops.end(); ++itr) + for (itr = ExplicitPossibleDrops.begin(); itr != ExplicitPossibleDrops.end(); ExplicitPossibleDrops.erase(itr)) { if (itr->chance >= 100.0f) { @@ -896,8 +896,6 @@ void LootTemplate::LootGroup::Process(Loot& loot, uint16 lootMode) const item = &*itr; break; } - // this item failed it's roll, so don't roll for it again - ExplicitPossibleDrops.erase(itr); } } if (item == NULL && !EqualPossibleDrops.empty()) // If nothing selected yet - an item is taken from equal-chanced part |