diff options
author | sapier <Sapier at GMX dot net> | 2013-01-16 23:27:11 +0000 |
---|---|---|
committer | sapier <Sapier at GMX dot net> | 2013-01-16 23:27:11 +0000 |
commit | 12e9f3d010f887c3fe0b32f3ddbf25f2ef6b7323 (patch) | |
tree | db34f1a9f85df0220f77a125d0a5e4183c33b7dd /src | |
parent | c691d619c24cdca11655455c510920ab7937b319 (diff) | |
download | minetest-12e9f3d010f887c3fe0b32f3ddbf25f2ef6b7323.tar.gz minetest-12e9f3d010f887c3fe0b32f3ddbf25f2ef6b7323.tar.bz2 minetest-12e9f3d010f887c3fe0b32f3ddbf25f2ef6b7323.zip |
add limit for steps to avoid runaway memory consumption by collision handling
Diffstat (limited to 'src')
-rw-r--r-- | src/collision.cpp | 4 |
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 |