Fix a crash caused by m_itemSoulboundTradeable. Fix #4266.

This commit is contained in:
megamage
2011-12-15 10:52:09 -05:00
parent ee8ed0247c
commit 6a4d68b8c2
+3 -13
View File
@@ -13300,11 +13300,7 @@ void Player::UpdateSoulboundTradeItems()
// also checks for garbage data
for (ItemDurationList::iterator itr = m_itemSoulboundTradeable.begin(); itr != m_itemSoulboundTradeable.end();)
{
if (!*itr)
{
m_itemSoulboundTradeable.erase(itr++);
continue;
}
ASSERT(*itr);
if ((*itr)->GetOwnerGUID() != GetGUID())
{
m_itemSoulboundTradeable.erase(itr++);
@@ -13319,16 +13315,10 @@ void Player::UpdateSoulboundTradeItems()
}
}
//TODO: should never allow an item to be added to m_itemSoulboundTradeable twice
void Player::RemoveTradeableItem(Item* item)
{
for (ItemDurationList::iterator itr = m_itemSoulboundTradeable.begin(); itr != m_itemSoulboundTradeable.end(); ++itr)
{
if ((*itr) == item)
{
m_itemSoulboundTradeable.erase(itr);
break;
}
}
m_itemSoulboundTradeable.remove(item);
}
void Player::UpdateItemDuration(uint32 time, bool realtimeonly)