aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorkwolekr <mirrorisim@gmail.com>2013-02-22 16:42:50 -0800
committerkwolekr <mirrorisim@gmail.com>2013-02-22 16:42:50 -0800
commitf9a8efb99235c86eb61b6deb2bc034d5618e45ea (patch)
treec5547496bd03947b702e81ead7dd1d030aeac2a8 /src
parent7f240aea1e55b0714e80ef6ab7172b58b0729f75 (diff)
parent12e9f3d010f887c3fe0b32f3ddbf25f2ef6b7323 (diff)
downloadminetest-f9a8efb99235c86eb61b6deb2bc034d5618e45ea.tar.gz
minetest-f9a8efb99235c86eb61b6deb2bc034d5618e45ea.tar.bz2
minetest-f9a8efb99235c86eb61b6deb2bc034d5618e45ea.zip
Merge pull request #431 from sapier/dtime_clamping
add limit for (collision handling) steps to avoid runaway memory consumption
Diffstat (limited to 'src')
-rw-r--r--src/collision.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/collision.cpp b/src/collision.cpp
index 143b559fa..eb948e3c3 100644
--- a/src/collision.cpp
+++ b/src/collision.cpp
@@ -199,6 +199,10 @@ collisionMoveResult collisionMoveSimple(Map *map, IGameDef *gamedef,
/*
Calculate new velocity
*/
+ if( dtime > 0.5 ) {
+ infostream<<"collisionMoveSimple: WARNING: maximum step interval exceeded, lost movement details!"<<std::endl;
+ dtime = 0.5;
+ }
speed_f += accel_f * dtime;
// If there is no speed, there are no collisions