Skip to content

Commit

Permalink
Merge pull request minetest#431 from sapier/dtime_clamping
Browse files Browse the repository at this point in the history
add limit for (collision handling) steps to avoid runaway memory consumption
  • Loading branch information
kwolekr committed Feb 23, 2013
2 parents 7f240ae + 12e9f3d commit f9a8efb
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/collision.cpp
Expand Up @@ -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
Expand Down

0 comments on commit f9a8efb

Please sign in to comment.