Skip to content

Commit f9a8efb

Browse files
author
kwolekr
committedFeb 23, 2013
Merge pull request luanti-org#431 from sapier/dtime_clamping
add limit for (collision handling) steps to avoid runaway memory consumption
2 parents 7f240ae + 12e9f3d commit f9a8efb

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed
 

‎src/collision.cpp

+4
Original file line numberDiff line numberDiff line change
@@ -199,6 +199,10 @@ collisionMoveResult collisionMoveSimple(Map *map, IGameDef *gamedef,
199199
/*
200200
Calculate new velocity
201201
*/
202+
if( dtime > 0.5 ) {
203+
infostream<<"collisionMoveSimple: WARNING: maximum step interval exceeded, lost movement details!"<<std::endl;
204+
dtime = 0.5;
205+
}
202206
speed_f += accel_f * dtime;
203207

204208
// If there is no speed, there are no collisions

0 commit comments

Comments
 (0)
Please sign in to comment.