aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rwxr-xr-xsrc/server/game/Server/WorldSession.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/server/game/Server/WorldSession.cpp b/src/server/game/Server/WorldSession.cpp
index a03c3570b43..55d1b7cdb6a 100755
--- a/src/server/game/Server/WorldSession.cpp
+++ b/src/server/game/Server/WorldSession.cpp
@@ -447,6 +447,9 @@ void WorldSession::LogoutPlayer(bool Save)
sSocialMgr.SendFriendStatus(_player, FRIEND_OFFLINE, _player->GetGUIDLow(), true);
sSocialMgr.RemovePlayerSocial (_player->GetGUIDLow ());
+ // Call script hook before deletion
+ sScriptMgr.OnPlayerLogout(GetPlayer());
+
///- Remove the player from the world
// the player may not be in the world when logging out
// e.g if he got disconnected during a transfer to another map
@@ -466,7 +469,6 @@ void WorldSession::LogoutPlayer(bool Save)
CharacterDatabase.PExecute("UPDATE characters SET online = 0 WHERE account = '%u'",
GetAccountId());
sLog.outDebug("SESSION: Sent SMSG_LOGOUT_COMPLETE Message");
- sScriptMgr.OnPlayerLogout(GetPlayer());
}
m_playerLogout = false;