replace assertion with clamping
This commit is contained in:
parent
e946ae8ac0
commit
532b9c0c50
|
|
@ -682,8 +682,11 @@ do_timeslice_accounting(ThreadSimpleImpl *thread, double now) {
|
|||
<< *thread->_parent_obj << " ran for " << elapsed << " s of "
|
||||
<< thread->_stop_time - thread->_start_time << " requested.\n";
|
||||
}
|
||||
|
||||
nassertv(elapsed >= 0.0);
|
||||
|
||||
// Clamp the elapsed time at 0. (If it's less than 0, the clock is
|
||||
// running backwards, ick.)
|
||||
elapsed = max(elapsed, 0.0);
|
||||
|
||||
unsigned int ticks = (unsigned int)(elapsed * _tick_scale + 0.5);
|
||||
thread->_run_ticks += ticks;
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue