mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-02-02 15:17:27 +01:00
*Fix a crash due to an invalidated iterator. Closes #420
--HG-- branch : trunk
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user