Skip to content

Commit

Permalink
Make collisionMoveSimple time overflow message written to log/show up…
Browse files Browse the repository at this point in the history
… at max once per step
  • Loading branch information
Sapier authored and Sapier committed Dec 29, 2015
1 parent 91bafce commit 61cb4d5
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions src/collision.cpp
Expand Up @@ -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;

Expand Down

0 comments on commit 61cb4d5

Please sign in to comment.