[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 VendorItemData::RemoveItem( uint32 item_id )
{ {
bool found = false; 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 // can have many examples
if((*i)->item == item_id) if((*i)->item == item_id)
{ {
m_items.erase(i); m_items.erase(i++);
found = true; found = true;
} }
else
++i;
} }
return found; return found;

View file

@ -1,4 +1,4 @@
#ifndef __REVISION_NR_H__ #ifndef __REVISION_NR_H__
#define __REVISION_NR_H__ #define __REVISION_NR_H__
#define REVISION_NR "9764" #define REVISION_NR "9765"
#endif // __REVISION_NR_H__ #endif // __REVISION_NR_H__