[9765] Prevent crash at use .npc delitem to item with multiply extanded costs.

This commit is contained in:
VladimirMangos 2010-04-19 13:34:22 +04:00
parent 6398abc725
commit f2dd9daf45
2 changed files with 5 additions and 3 deletions

View file

@ -59,14 +59,16 @@ 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(); )
{
// can have many examples
if((*i)->item == item_id)
{
m_items.erase(i);
m_items.erase(i++);
found = true;
}
else
++i;
}
return found;