mirror of
https://github.com/minetest/minetest.git
synced 2024-11-27 10:03:45 +01:00
Make collisionMoveSimple time overflow message written to log/show up at max once per step
This commit is contained in:
parent
91bafceee6
commit
61cb4d52a6
@ -199,18 +199,25 @@ collisionMoveResult collisionMoveSimple(Environment *env, IGameDef *gamedef,
|
|||||||
v3f &accel_f,ActiveObject* self,
|
v3f &accel_f,ActiveObject* self,
|
||||||
bool collideWithObjects)
|
bool collideWithObjects)
|
||||||
{
|
{
|
||||||
|
static bool time_notification_done = false;
|
||||||
Map *map = &env->getMap();
|
Map *map = &env->getMap();
|
||||||
//TimeTaker tt("collisionMoveSimple");
|
//TimeTaker tt("collisionMoveSimple");
|
||||||
ScopeProfiler sp(g_profiler, "collisionMoveSimple avg", SPT_AVG);
|
ScopeProfiler sp(g_profiler, "collisionMoveSimple avg", SPT_AVG);
|
||||||
|
|
||||||
collisionMoveResult result;
|
collisionMoveResult result;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
Calculate new velocity
|
Calculate new velocity
|
||||||
*/
|
*/
|
||||||
if( dtime > 0.5 ) {
|
if (dtime > 0.5) {
|
||||||
warningstream<<"collisionMoveSimple: maximum step interval exceeded, lost movement details!"<<std::endl;
|
if (!time_notification_done) {
|
||||||
|
time_notification_done = true;
|
||||||
|
infostream << "collisionMoveSimple: maximum step interval exceeded,"
|
||||||
|
" lost movement details!"<<std::endl;
|
||||||
|
}
|
||||||
dtime = 0.5;
|
dtime = 0.5;
|
||||||
|
} else {
|
||||||
|
time_notification_done = false;
|
||||||
}
|
}
|
||||||
speed_f += accel_f * dtime;
|
speed_f += accel_f * dtime;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user