mirror of
https://github.com/luanti-org/luanti.git
synced 2025-06-27 16:36:03 +00:00
Fix player getting reset to 0,0 at connect if being far from 0,0
This commit is contained in:
parent
661ed387df
commit
49e4f55b09
1 changed files with 5 additions and 1 deletions
|
@ -472,6 +472,8 @@ void ServerEnvironment::deSerializePlayers(const std::string &savedir)
|
||||||
newplayer = true;
|
newplayer = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
ServerRemotePlayer *srp = static_cast<ServerRemotePlayer*>(player);
|
||||||
|
|
||||||
// Load player
|
// Load player
|
||||||
{
|
{
|
||||||
infostream<<"Reading player "<<testplayer.getName()<<" from "
|
infostream<<"Reading player "<<testplayer.getName()<<" from "
|
||||||
|
@ -483,7 +485,9 @@ void ServerEnvironment::deSerializePlayers(const std::string &savedir)
|
||||||
infostream<<"Failed to read "<<path<<std::endl;
|
infostream<<"Failed to read "<<path<<std::endl;
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
player->deSerialize(is);
|
srp->deSerialize(is);
|
||||||
|
srp->m_last_good_position = srp->getBasePosition();
|
||||||
|
srp->m_last_good_position_age = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(newplayer)
|
if(newplayer)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue