From 42dd108d9da8726db34efd73b93053da1c035e76 Mon Sep 17 00:00:00 2001 From: Spoike Date: Mon, 6 Dec 2004 01:59:05 +0000 Subject: [PATCH] Client should again be able to record non-corrupt demos - remember the cl_nopext thing. git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@583 fc73d0e0-1445-4013-8a0c-d673dee63da5 --- engine/client/cl_demo.c | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/engine/client/cl_demo.c b/engine/client/cl_demo.c index b795f92aa..81f03c395 100644 --- a/engine/client/cl_demo.c +++ b/engine/client/cl_demo.c @@ -77,7 +77,7 @@ void CL_WriteDemoCmd (usercmd_t *pcmd) int i; float fl; qbyte c; - usercmd_t cmd; + q1usercmd_t cmd; //Con_Printf("write: %ld bytes, %4.4f\n", msg->cursize, realtime); @@ -87,14 +87,18 @@ void CL_WriteDemoCmd (usercmd_t *pcmd) c = dem_cmd; fwrite (&c, sizeof(c), 1, cls.demofile); - // correct for qbyte order, bytes don't matter - cmd = *pcmd; + // correct for byte order, bytes don't matter + + cmd.buttons = pcmd->buttons; + cmd.impulse = pcmd->impulse; + cmd.msec = pcmd->msec; for (i = 0; i < 3; i++) - cmd.angles[i] = LittleFloat(cmd.angles[i]); - cmd.forwardmove = LittleShort(cmd.forwardmove); - cmd.sidemove = LittleShort(cmd.sidemove); - cmd.upmove = LittleShort(cmd.upmove); + cmd.angles[i] = LittleFloat(pcmd->angles[i]*65536/360); + + cmd.forwardmove = LittleShort(pcmd->forwardmove); + cmd.sidemove = LittleShort(pcmd->sidemove); + cmd.upmove = LittleShort(pcmd->upmove); fwrite(&cmd, sizeof(cmd), 1, cls.demofile);