aboutsummaryrefslogtreecommitdiff
path: root/src/game/LootMgr.cpp
diff options
context:
space:
mode:
authorMachiavelli <none@none>2009-12-05 01:28:15 +0100
committerMachiavelli <none@none>2009-12-05 01:28:15 +0100
commit76c57e111a803f3ac0c8871919fc824f38ab0c40 (patch)
tree02a2fc7ab6b8d4e6c7e2f49779b9ad0896e5438f /src/game/LootMgr.cpp
parente83f90bfe34c3c7c5d46b4238eb189368d2c9fac (diff)
Fix iterator related crash for some windows debug builds in LootTemplate::LooutGroup::Process.
--HG-- branch : trunk
Diffstat (limited to 'src/game/LootMgr.cpp')
-rw-r--r--src/game/LootMgr.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/game/LootMgr.cpp b/src/game/LootMgr.cpp
index d62daab09f7..e51945b3684 100644
--- a/src/game/LootMgr.cpp
+++ b/src/game/LootMgr.cpp
@@ -882,7 +882,8 @@ 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(); ExplicitPossibleDrops.erase(itr))
+ itr = ExplicitPossibleDrops.begin();
+ while (itr != ExplicitPossibleDrops.end())
{
if (itr->chance >= 100.0f)
{
@@ -896,6 +897,7 @@ void LootTemplate::LootGroup::Process(Loot& loot, uint16 lootMode) const
item = &*itr;
break;
}
+ itr = ExplicitPossibleDrops.erase(itr);
}
}
if (item == NULL && !EqualPossibleDrops.empty()) // If nothing selected yet - an item is taken from equal-chanced part