aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorSapier <sapier AT gmx dot net>2015-12-18 19:20:06 +0100
committerSapier <sapier AT gmx dot net>2015-12-29 17:02:17 +0100
commit61cb4d52a6873a0af69bb8c9a295586f09b2c27a (patch)
tree7c7a3e40f50bdbbb82669970376f6060e474b7da /src
parent91bafceee6606fab79db1bde4cba01b84fed65c7 (diff)
downloadminetest-61cb4d52a6873a0af69bb8c9a295586f09b2c27a.tar.gz
minetest-61cb4d52a6873a0af69bb8c9a295586f09b2c27a.tar.bz2
minetest-61cb4d52a6873a0af69bb8c9a295586f09b2c27a.zip
Make collisionMoveSimple time overflow message written to log/show up at max once per step
Diffstat (limited to 'src')
-rw-r--r--src/collision.cpp13
1 files changed, 10 insertions, 3 deletions
diff --git a/src/collision.cpp b/src/collision.cpp
index 2b64547c3..187df0a5d 100644
--- a/src/collision.cpp
+++ b/src/collision.cpp
@@ -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;