mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-22 02:04:52 +01:00
*Call item::removefromworld after unit::removefromworld to prevent crash.
--HG-- branch : trunk
This commit is contained in:
@@ -1838,6 +1838,11 @@ void Player::RemoveFromWorld()
|
||||
sOutdoorPvPMgr.HandlePlayerLeaveZone(this, m_zoneUpdateId);
|
||||
}
|
||||
|
||||
///- Do not add/remove the player from the object storage
|
||||
///- It will crash when updating the ObjectAccessor
|
||||
///- The player should only be removed when logging out
|
||||
Unit::RemoveFromWorld();
|
||||
|
||||
for(int i = PLAYER_SLOT_START; i < PLAYER_SLOT_END; ++i)
|
||||
{
|
||||
if(m_items[i])
|
||||
@@ -1847,11 +1852,6 @@ void Player::RemoveFromWorld()
|
||||
for (ItemMap::iterator iter = mMitems.begin(); iter != mMitems.end(); ++iter)
|
||||
iter->second->RemoveFromWorld();
|
||||
|
||||
///- Do not add/remove the player from the object storage
|
||||
///- It will crash when updating the ObjectAccessor
|
||||
///- The player should only be removed when logging out
|
||||
Unit::RemoveFromWorld();
|
||||
|
||||
if(m_uint32Values)
|
||||
{
|
||||
if(WorldObject *viewpoint = GetViewpoint())
|
||||
|
||||
Reference in New Issue
Block a user