client: send 16-bit angles when server is fitzquake

This should now be all that is needed on the client side for FitzQuake
protocol (666) support.

Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
This commit is contained in:
Kevin Shanahan 2013-01-14 20:57:20 +10:30
parent 1c842c0bac
commit ef14eecafe
2 changed files with 7 additions and 4 deletions

@ -527,7 +527,10 @@ CL_SendMove(usercmd_t *cmd)
MSG_WriteFloat(&buf, cl.mtime[0]); /* so server can get ping times */
for (i = 0; i < 3; i++)
MSG_WriteAngle(&buf, cl.viewangles[i]);
if (cl.protocol == PROTOCOL_VERSION_FITZ)
MSG_WriteAngle16(&buf, cl.viewangles[i]);
else
MSG_WriteAngle(&buf, cl.viewangles[i]);
MSG_WriteShort(&buf, cmd->forwardmove);
MSG_WriteShort(&buf, cmd->sidemove);

@ -520,16 +520,16 @@ MSG_WriteCoord(sizebuf_t *sb, float f)
void
MSG_WriteAngle(sizebuf_t *sb, float f)
{
MSG_WriteByte(sb, (int)(f * 256 / 360) & 255);
MSG_WriteByte(sb, (int)floorf((f * 256 / 360) + 0.5f) & 255);
}
#ifdef QW_HACK
void
MSG_WriteAngle16(sizebuf_t *sb, float f)
{
MSG_WriteShort(sb, (int)(f * 65536 / 360) & 65535);
MSG_WriteShort(sb, (int)floorf((f * 65536 / 360) + 0.5f) & 65535);
}
#ifdef QW_HACK
void
MSG_WriteDeltaUsercmd(sizebuf_t *buf, const usercmd_t *from,
const usercmd_t *cmd)