From: Esteban I. Ruiz Moreno Date: Tue, 2 Apr 2013 23:24:45 +0000 (-0300) Subject: Limit speed in collisionMoveResult for avoiding hangs X-Git-Url: http://81.2.79.47:8989/gitweb/?a=commitdiff_plain;h=6b8435cf8c92b0d6e2988a7c5034148bd74d387b;p=zefram%2Fminetest%2Fminetest_engine.git Limit speed in collisionMoveResult for avoiding hangs --- diff --git a/src/collision.cpp b/src/collision.cpp index 806a3b72..cd170196 100644 --- a/src/collision.cpp +++ b/src/collision.cpp @@ -209,10 +209,15 @@ collisionMoveResult collisionMoveSimple(Environment *env, IGameDef *gamedef, } speed_f += accel_f * dtime; - // If there is no speed, there are no collisions + // If there is no speed, there are no collisions if(speed_f.getLength() == 0) return result; + // Limit speed for avoiding hangs + speed_f.Y=rangelim(speed_f.Y,-5000,5000); + speed_f.X=rangelim(speed_f.X,-5000,5000); + speed_f.Z=rangelim(speed_f.Z,-5000,5000); + /* Collect node boxes in movement range */