Skip to content
Permalink
Browse files

Merge pull request minetest#431 from sapier/dtime_clamping

add limit for (collision handling) steps to avoid runaway memory consumption
  • Loading branch information
kwolekr committed Feb 23, 2013
2 parents 7f240ae + 12e9f3d commit f9a8efb99235c86eb61b6deb2bc034d5618e45ea
Showing with 4 additions and 0 deletions.
  1. +4 −0 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

0 comments on commit f9a8efb

Please sign in to comment.