diff options
author | click <none@none> | 2010-05-05 14:30:53 +0200 |
---|---|---|
committer | click <none@none> | 2010-05-05 14:30:53 +0200 |
commit | 173d30879f73aa1a887ea6ae59f5bed9cc347400 (patch) | |
tree | a485ced9427728a014bc2bcbef3a06f2cbbf0a62 /src/game/Creature.cpp | |
parent | 1acb837a332ee59fb815277dfcf9626cf55d5f8b (diff) |
Fix crash when deleting vendoritems with multiple extendedcosts - thanks to Vladimir
Fixes issue #1989
--HG--
branch : trunk
Diffstat (limited to 'src/game/Creature.cpp')
-rw-r--r-- | src/game/Creature.cpp | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/game/Creature.cpp b/src/game/Creature.cpp index 3a124b2a999..34372ac614d 100644 --- a/src/game/Creature.cpp +++ b/src/game/Creature.cpp @@ -63,13 +63,15 @@ TrainerSpell const* TrainerSpellData::Find(uint32 spell_id) const bool VendorItemData::RemoveItem(uint32 item_id) { bool found = false; - for (VendorItemList::iterator i = m_items.begin(); i != m_items.end(); ++i) + for (VendorItemList::iterator i = m_items.begin(); i != m_items.end();) { if ((*i)->item == item_id) { - i = m_items.erase(i); + i = m_items.erase(i++); found = true; } + else + ++i; } return found; } |