LuaVoxelManip: Add option to allocate blank data
[oweals/minetest.git] / src / content_sao.cpp
index 095c6b5bf26c969f064e752fe815aa3d272df2aa..1edddec7b054e507e14597826b5ad0eb3ed3ce28 100644 (file)
@@ -18,6 +18,8 @@ with this program; if not, write to the Free Software Foundation, Inc.,
 */
 
 #include "content_sao.h"
+#include "util/serialize.h"
+#include "util/mathconstants.h"
 #include "collision.h"
 #include "environment.h"
 #include "settings.h"
@@ -29,8 +31,7 @@ with this program; if not, write to the Free Software Foundation, Inc.,
 #include "player.h"
 #include "scripting_game.h"
 #include "genericobject.h"
-#include "util/serialize.h"
-#include "util/mathconstants.h"
+#include "log.h"
 
 std::map<u16, ServerActiveObject::Factory> ServerActiveObject::m_types;
 
@@ -1027,6 +1028,8 @@ void PlayerSAO::removingFromEnvironment()
        {
                m_player->setPlayerSAO(NULL);
                m_player->peer_id = 0;
+               m_env->savePlayer(m_player->getName());
+               m_env->removePlayer(m_player->getName());
        }
 }
 
@@ -1035,11 +1038,6 @@ bool PlayerSAO::isStaticAllowed() const
        return false;
 }
 
-bool PlayerSAO::unlimitedTransferDistance() const
-{
-       return g_settings->getBool("unlimited_player_transfer_distance");
-}
-
 std::string PlayerSAO::getClientInitializationData(u16 protocol_version)
 {
        std::ostringstream os(std::ios::binary);