From 66bb2954362748c4722d366d0df490ad51a591a2 Mon Sep 17 00:00:00 2001 From: Ner'zhul Date: Sat, 5 Nov 2016 10:25:30 +0100 Subject: PlayerSAO saving fix (#4734) PlayerSAO::disconnected() function was historical and remove the link between SAO and RemotePlayer session. With previous attributes linked to RemotePlayer saving was working. But now attributes are read from SAO not RemotePlayer and the current serialize function verify SAO exists to save the player attributes. Because PlayerSAO::disconnected marks playersao for removal, only mark playerSAO for removal and let PlayerSAO::removingFromEnvironment do the correct saving behaviour and all the disconnection process instead of doing a partial removal and let the server loop doing the RemotePlayer cleanup and remove some saved attributes... --- src/server.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/server.cpp') diff --git a/src/server.cpp b/src/server.cpp index cd526ad77..48331e4f8 100644 --- a/src/server.cpp +++ b/src/server.cpp @@ -2654,7 +2654,7 @@ void Server::DeleteClient(u16 peer_id, ClientDeletionReason reason) RemotePlayer *player = m_env->getPlayer(peer_id); /* Run scripts and remove from environment */ - if(player != NULL) { + if (player != NULL) { PlayerSAO *playersao = player->getPlayerSAO(); assert(playersao); -- cgit v1.2.3