diff options
author | Perttu Ahola <celeron55@gmail.com> | 2011-11-26 15:58:02 +0200 |
---|---|---|
committer | Perttu Ahola <celeron55@gmail.com> | 2011-11-29 19:13:54 +0200 |
commit | 41c473cf5e3f217007f48b0dacf46b00d1039068 (patch) | |
tree | d3beee0bdd2abc3ee926c7b226a8b29811bc5636 | |
parent | b2ccbdffc1d85e320ef55c8994fae022dcef96f8 (diff) | |
download | minetest-41c473cf5e3f217007f48b0dacf46b00d1039068.tar.gz minetest-41c473cf5e3f217007f48b0dacf46b00d1039068.tar.bz2 minetest-41c473cf5e3f217007f48b0dacf46b00d1039068.zip |
Fix player getting thrown underground after connecting
-rw-r--r-- | src/environment.cpp | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/environment.cpp b/src/environment.cpp index c2bc2692e..39ecf423c 100644 --- a/src/environment.cpp +++ b/src/environment.cpp @@ -1974,8 +1974,7 @@ void ClientEnvironment::step(float dtime) */ bool is_climbing = lplayer->is_climbing; - f32 player_speed = 0.001; // just some small value - player_speed = lplayer->getSpeed().getLength(); + f32 player_speed = lplayer->getSpeed().getLength(); /* Maximum position increment @@ -1985,7 +1984,9 @@ void ClientEnvironment::step(float dtime) // Maximum time increment (for collision detection etc) // time = distance / speed - f32 dtime_max_increment = position_max_increment / player_speed; + f32 dtime_max_increment = 1; + if(player_speed > 0.001) + dtime_max_increment = position_max_increment / player_speed; // Maximum time increment is 10ms or lower if(dtime_max_increment > 0.01) |