Skip to content

Commit

Permalink
Fix a crash caused by m_itemSoulboundTradeable. Fix #4266.
Browse files Browse the repository at this point in the history
  • Loading branch information
megamage committed Dec 15, 2011
1 parent ee8ed02 commit 6a4d68b
Showing 1 changed file with 3 additions and 13 deletions.
16 changes: 3 additions & 13 deletions src/server/game/Entities/Player/Player.cpp
Expand Up @@ -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++);
Expand All @@ -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)
Expand Down

2 comments on commit 6a4d68b

@2010phenix
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+1 thanks for quick fixing

@marvin-w
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+1 thank you

Please sign in to comment.