Skip to content
Snippets Groups Projects
Commit 49e4f55b authored by Perttu Ahola's avatar Perttu Ahola
Browse files

Fix player getting reset to 0,0 at connect if being far from 0,0

parent 661ed387
No related branches found
No related tags found
No related merge requests found
......@@ -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)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment