projects
/
zefram
/
minetest
/
minetest_engine.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
661ed38
)
Fix player getting reset to 0,0 at connect if being far from 0,0
author
Perttu Ahola
<celeron55@gmail.com>
Tue, 29 Nov 2011 22:39:36 +0000
(
00:39
+0200)
committer
Perttu Ahola
<celeron55@gmail.com>
Tue, 29 Nov 2011 22:39:36 +0000
(
00:39
+0200)
src/environment.cpp
patch
|
blob
|
history
diff --git
a/src/environment.cpp
b/src/environment.cpp
index 41ba52a6fd364fe7331970bff7a83b1cebd1ca90..9748f6b71d00c77487554b4c7f395696ee3eac94 100644
(file)
--- 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)