Get the format of the time hack packet correct.

dem_read has a length word, which I had failed to see at the time. It
seems that mvd's don't mind a zero length packets.
This commit is contained in:
Bill Currie 2010-12-01 08:04:24 +09:00
parent b1e5a5f4c2
commit c416e15cd7

View file

@ -166,14 +166,12 @@ write_msg (sizebuf_t *msg, int type, int to, float time, sizebuf_t *dst)
msec = (time - prevtime) * 1000; msec = (time - prevtime) * 1000;
prevtime += msec * 0.001; prevtime += msec * 0.001;
while (msec > 250) { while (msec > 250) {
//the maximum interval we can send is 255ms, but that's nasty with, //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 //floats, so keep things to a nice round number of 250ms (0.25 is float
//friendly) //friendly)
MSG_WriteByte (dst, 250); MSG_WriteByte (dst, 250);
MSG_WriteByte (dst, dem_read); MSG_WriteByte (dst, dem_read);
MSG_WriteLong (dst, -1); MSG_WriteLong (dst, 0);
MSG_WriteByte (dst, A2C_PRINT);
MSG_WriteString (dst, "");
msec -= 250; msec -= 250;
} }
if (msec < 2) if (msec < 2)