Make collisionMoveSimple time overflow message written to log/show up at max once... 3467/head
authorSapier <sapier AT gmx dot net>
Fri, 18 Dec 2015 18:20:06 +0000 (19:20 +0100)
committerSapier <sapier AT gmx dot net>
Tue, 29 Dec 2015 16:02:17 +0000 (17:02 +0100)
src/collision.cpp

index 2b64547c3ad7d0de82d9d8603b94512ea921f777..187df0a5d2d52ca2b820715122be020929fd4b58 100644 (file)
@@ -199,18 +199,25 @@ collisionMoveResult collisionMoveSimple(Environment *env, IGameDef *gamedef,
                v3f &accel_f,ActiveObject* self,
                bool collideWithObjects)
 {
+       static bool time_notification_done = false;
        Map *map = &env->getMap();
        //TimeTaker tt("collisionMoveSimple");
-    ScopeProfiler sp(g_profiler, "collisionMoveSimple avg", SPT_AVG);
+       ScopeProfiler sp(g_profiler, "collisionMoveSimple avg", SPT_AVG);
 
        collisionMoveResult result;
 
        /*
                Calculate new velocity
        */
-       if( dtime > 0.5 ) {
-               warningstream<<"collisionMoveSimple: maximum step interval exceeded, lost movement details!"<<std::endl;
+       if (dtime > 0.5) {
+               if (!time_notification_done) {
+                       time_notification_done = true;
+                       infostream << "collisionMoveSimple: maximum step interval exceeded,"
+                                       " lost movement details!"<<std::endl;
+               }
                dtime = 0.5;
+       } else {
+               time_notification_done = false;
        }
        speed_f += accel_f * dtime;