diff options
author | megamage <none@none> | 2009-06-18 10:45:38 -0500 |
---|---|---|
committer | megamage <none@none> | 2009-06-18 10:45:38 -0500 |
commit | 4f10fa008dca092bb7a9ad36e0df7d568b3ef22f (patch) | |
tree | 1c5058ab01c683a9e4e939040e1ae9623c42a212 /src | |
parent | 3a309abfab3762d1c3bc2f90b961582e83d5971a (diff) |
*Call item::removefromworld after unit::removefromworld to prevent crash.
--HG--
branch : trunk
Diffstat (limited to 'src')
-rw-r--r-- | src/game/Player.cpp | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/game/Player.cpp b/src/game/Player.cpp index 07b3f62c3c5..212ada7f450 100644 --- a/src/game/Player.cpp +++ b/src/game/Player.cpp @@ -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()) |