summaryrefslogtreecommitdiff
path: root/src/server.cpp
diff options
context:
space:
mode:
authorNer'zhul <nerzhul@users.noreply.github.com>2016-11-05 10:25:30 +0100
committerGitHub <noreply@github.com>2016-11-05 10:25:30 +0100
commit66bb2954362748c4722d366d0df490ad51a591a2 (patch)
treeafccdbd313686ab10e98c62729745e8252089bd6 /src/server.cpp
parentb5c84c34ce283a56317902d24067d9a0795a44c5 (diff)
downloadminetest-66bb2954362748c4722d366d0df490ad51a591a2.tar.gz
minetest-66bb2954362748c4722d366d0df490ad51a591a2.tar.bz2
minetest-66bb2954362748c4722d366d0df490ad51a591a2.zip
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...
Diffstat (limited to 'src/server.cpp')
-rw-r--r--src/server.cpp2
1 files changed, 1 insertions, 1 deletions
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);