Fix player getting thrown underground after connecting
authorPerttu Ahola <celeron55@gmail.com>
Sat, 26 Nov 2011 13:58:02 +0000 (15:58 +0200)
committerPerttu Ahola <celeron55@gmail.com>
Tue, 29 Nov 2011 17:13:54 +0000 (19:13 +0200)
src/environment.cpp

index c2bc2692e26092e664f54cac475667096b9eee80..39ecf423c7d0fac289a06aae1df85320b54ba54e 100644 (file)
@@ -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)