]> git.lizzy.rs Git - dragonfireclient.git/blobdiff - src/environment.cpp
new hotbar, more minecraft-like
[dragonfireclient.git] / src / environment.cpp
index e8a01a4a15397944cb81658b5bfe4dfaa3f3bbd2..07437ec400057dc175d60622eea739812c7c4699 100644 (file)
@@ -67,10 +67,15 @@ void Environment::step(float dtime)
        }
        //playerspeed.stop();
        
+       /*
+               Maximum position increment
+       */
+       //f32 position_max_increment = 0.05*BS;
+       f32 position_max_increment = 0.1*BS;
+
        // Maximum time increment (for collision detection etc)
-       // Allow 0.1 blocks per increment
        // time = distance / speed
-       f32 dtime_max_increment = 0.1*BS / maximum_player_speed;
+       f32 dtime_max_increment = position_max_increment / maximum_player_speed;
        // Maximum time increment is 10ms or lower
        if(dtime_max_increment > 0.01)
                dtime_max_increment = 0.01;
@@ -118,9 +123,9 @@ void Environment::step(float dtime)
                                /*
                                        Apply water resistance
                                */
-                               if(player->in_water_stable)
+                               if(player->in_water_stable || player->in_water)
                                {
-                                       f32 max_down = 1.5*BS;
+                                       f32 max_down = 2.0*BS;
                                        if(speed.Y < -max_down) speed.Y = -max_down;
 
                                        f32 max = 2.5*BS;
@@ -137,7 +142,7 @@ void Environment::step(float dtime)
                                Move the player.
                                For local player, this also calculates collision detection.
                        */
-                       player->move(dtime_part, *m_map);
+                       player->move(dtime_part, *m_map, position_max_increment);
                        
                        /*
                                Update lighting on remote players on client