From 8a57ab9bc617d5a0187857c895dd394de2cef08c Mon Sep 17 00:00:00 2001 From: Mark Olsen Date: Fri, 12 Aug 2005 23:26:12 +0000 Subject: [PATCH] Fix build, fix segfault. git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@1228 fc73d0e0-1445-4013-8a0c-d673dee63da5 --- engine/sw/vid_x.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/engine/sw/vid_x.c b/engine/sw/vid_x.c index 15a030d3..f3bf5cf3 100644 --- a/engine/sw/vid_x.c +++ b/engine/sw/vid_x.c @@ -1290,6 +1290,7 @@ extern int mousecursor_x, mousecursor_y; void IN_Move (usercmd_t *cmd, int pnum) { float mx, my; + float mouse_deltadist; if (!mouse_avail) { @@ -1347,10 +1348,13 @@ void IN_Move (usercmd_t *cmd, int pnum) cl.viewangles[pnum][PITCH] += m_pitch.value * mouse_y; CL_ClampPitch(pnum); } else { - if ((in_strafe.state[pnum] & 1) && noclip_anglehack) - cmd->upmove -= m_forward.value * mouse_y; - else - cmd->forwardmove -= m_forward.value * mouse_y; + if (cmd) + { + if ((in_strafe.state[pnum] & 1) && noclip_anglehack) + cmd->upmove -= m_forward.value * mouse_y; + else + cmd->forwardmove -= m_forward.value * mouse_y; + } } mouse_x = mouse_y = 0.0; }