diff options
author | Perttu Ahola <celeron55@gmail.com> | 2011-11-30 00:39:36 +0200 |
---|---|---|
committer | Perttu Ahola <celeron55@gmail.com> | 2011-11-30 00:39:36 +0200 |
commit | 49e4f55b09808e5fbc7fbd5fc0b02937df82671d (patch) | |
tree | d23ef29d4fa98516394e7c8725dd7f49b5967c49 /src | |
parent | 661ed387dfc672b6e33945a60f5d1022f826c91b (diff) | |
download | minetest-49e4f55b09808e5fbc7fbd5fc0b02937df82671d.tar.gz minetest-49e4f55b09808e5fbc7fbd5fc0b02937df82671d.tar.bz2 minetest-49e4f55b09808e5fbc7fbd5fc0b02937df82671d.zip |
Fix player getting reset to 0,0 at connect if being far from 0,0
Diffstat (limited to 'src')
-rw-r--r-- | src/environment.cpp | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/environment.cpp b/src/environment.cpp index 41ba52a6f..9748f6b71 100644 --- a/src/environment.cpp +++ b/src/environment.cpp @@ -472,6 +472,8 @@ void ServerEnvironment::deSerializePlayers(const std::string &savedir) newplayer = true; } + ServerRemotePlayer *srp = static_cast<ServerRemotePlayer*>(player); + // Load player { infostream<<"Reading player "<<testplayer.getName()<<" from " @@ -483,7 +485,9 @@ void ServerEnvironment::deSerializePlayers(const std::string &savedir) infostream<<"Failed to read "<<path<<std::endl; continue; } - player->deSerialize(is); + srp->deSerialize(is); + srp->m_last_good_position = srp->getBasePosition(); + srp->m_last_good_position_age = 0; } if(newplayer) |