aboutsummaryrefslogtreecommitdiff
path: root/src/environment.cpp
diff options
context:
space:
mode:
authorPerttu Ahola <celeron55@gmail.com>2011-02-14 02:54:15 +0200
committerPerttu Ahola <celeron55@gmail.com>2011-02-14 02:54:15 +0200
commit14fafc72177fdc77bf8c8955363c77719f74e33b (patch)
treeff5e70feac29944b1a5acb1aa3d5ba7425d37e8c /src/environment.cpp
parent0947c4cc48ec9aed0a831973e7e79f8d57d34bc3 (diff)
downloadminetest-14fafc72177fdc77bf8c8955363c77719f74e33b.tar.xz
added sneaking/crouching and changelog
Diffstat (limited to 'src/environment.cpp')
-rw-r--r--src/environment.cpp11
1 files changed, 8 insertions, 3 deletions
diff --git a/src/environment.cpp b/src/environment.cpp
index ecf853b7c..07437ec40 100644
--- a/src/environment.cpp
+++ b/src/environment.cpp
@@ -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;
@@ -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