Merge pull request #431 from sapier/dtime_clamping

add limit for (collision handling) steps to avoid runaway memory consumption
This commit is contained in:
kwolekr 2013-02-22 16:42:50 -08:00
commit f9a8efb992
1 changed files with 4 additions and 0 deletions

View File

@ -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