From 30b10b05d33f1227650bcad0e70456da02f06264 Mon Sep 17 00:00:00 2001 From: toasterbabe Date: Fri, 14 Apr 2017 21:01:45 +0100 Subject: [PATCH] Change analog mouse to apply turning buttons, because aa. --- src/g_game.c | 25 ++++++++++++++++++++++--- 1 file changed, 22 insertions(+), 3 deletions(-) diff --git a/src/g_game.c b/src/g_game.c index 64f84d544..858cf9c3f 100644 --- a/src/g_game.c +++ b/src/g_game.c @@ -1185,10 +1185,19 @@ void G_BuildTiccmd(ticcmd_t *cmd, INT32 realtics) if (!mouseaiming && cv_mousemove.value) forward += mousey; - if (cv_analog.value || - (!demoplayback && (player->climbing + if ((!demoplayback && (player->climbing || (player->pflags & PF_SLIDING)))) // Analog for mouse side += mousex*2; + else if (cv_analog.value) + { + if (mousex) + { + if (mousex > 0) + cmd->buttons |= BT_CAMRIGHT; + else + cmd->buttons |= BT_CAMLEFT; + } + } else cmd->angleturn = (INT16)(cmd->angleturn - (mousex*8)); @@ -1471,9 +1480,19 @@ void G_BuildTiccmd2(ticcmd_t *cmd, INT32 realtics) if (!mouseaiming && cv_mousemove2.value) forward += mouse2y; - if (cv_analog2.value || player->climbing + if (player->climbing || (player->pflags & PF_SLIDING)) // Analog for mouse side += mouse2x*2; + else if (cv_analog2.value) + { + if (mouse2x) + { + if (mouse2x > 0) + cmd->buttons |= BT_CAMRIGHT; + else + cmd->buttons |= BT_CAMLEFT; + } + } else cmd->angleturn = (INT16)(cmd->angleturn - (mouse2x*8));