Limit the amount of time that MVDs can skip.

Trying to cover very long times will probably cause more problems than it
fixes, so limit the length of time. Two seconds aught to be enough for
now. Need to look into proper handling of prevtime.
This commit is contained in:
Bill Currie 2010-12-01 08:11:45 +09:00
parent c416e15cd7
commit 532e79bca6
1 changed files with 2 additions and 0 deletions

View File

@ -165,6 +165,8 @@ write_msg (sizebuf_t *msg, int type, int to, float time, sizebuf_t *dst)
msec = (time - prevtime) * 1000;
prevtime += msec * 0.001;
if (msec > 2000)
msec = 2000;
while (msec > 250) {
//the maximum interval we can send is 255ms, but that's nasty with
//floats, so keep things to a nice round number of 250ms (0.25 is float