diff --git a/src/g_game.c b/src/g_game.c index 63055a8c4..a087a0ad6 100644 --- a/src/g_game.c +++ b/src/g_game.c @@ -981,7 +981,7 @@ void G_BuildTiccmd(ticcmd_t *cmd, INT32 realtics) INT32 tspeed, forward, side, axis, i; const INT32 speed = 1; // these ones used for multiple conditions - boolean turnleft, turnright, mouseaiming, analogjoystickmove, gamepadjoystickmove; + boolean turnleft, turnright, strafelkey, straferkey, movefkey, movebkey, mouseaiming, analogjoystickmove, gamepadjoystickmove; player_t *player = &players[consoleplayer]; camera_t *thiscam = &camera; @@ -1002,6 +1002,12 @@ void G_BuildTiccmd(ticcmd_t *cmd, INT32 realtics) turnright = PLAYER1INPUTDOWN(gc_turnright); turnleft = PLAYER1INPUTDOWN(gc_turnleft); + + straferkey = PLAYER1INPUTDOWN(gc_straferight); + strafelkey = PLAYER1INPUTDOWN(gc_strafeleft); + movefkey = PLAYER1INPUTDOWN(gc_forward); + movebkey = PLAYER1INPUTDOWN(gc_backward); + mouseaiming = (PLAYER1INPUTDOWN(gc_mouseaiming)) ^ cv_alwaysfreelook.value; analogjoystickmove = cv_usejoystick.value && !Joystick.bGamepadStyle; gamepadjoystickmove = cv_usejoystick.value && Joystick.bGamepadStyle; @@ -1090,9 +1096,9 @@ void G_BuildTiccmd(ticcmd_t *cmd, INT32 realtics) // forward with key or button axis = JoyAxis(AXISMOVE); - if (PLAYER1INPUTDOWN(gc_forward) || (gamepadjoystickmove && axis < 0)) + if (movefkey || (gamepadjoystickmove && axis < 0)) forward = forwardmove[speed]; - if (PLAYER1INPUTDOWN(gc_backward) || (gamepadjoystickmove && axis > 0)) + if (movebkey || (gamepadjoystickmove && axis > 0)) forward -= forwardmove[speed]; if (analogjoystickmove && axis != 0) @@ -1100,9 +1106,9 @@ void G_BuildTiccmd(ticcmd_t *cmd, INT32 realtics) // some people strafe left & right with mouse buttons // those people are weird - if (PLAYER1INPUTDOWN(gc_straferight)) + if (straferkey) side += sidemove[speed]; - if (PLAYER1INPUTDOWN(gc_strafeleft)) + if (strafelkey) side -= sidemove[speed]; if (PLAYER1INPUTDOWN(gc_weaponnext)) @@ -1239,7 +1245,8 @@ void G_BuildTiccmd(ticcmd_t *cmd, INT32 realtics) // No additional acceleration when moving forward/backward and strafing simultaneously. // do this AFTER we cap to MAXPLMOVE so people can't find ways to cheese around this. - if (!forcestrafe && forward && side) + // 9-18-2017: ALSO, only do this when using keys to move. Gamepad analog sticks get severely gimped by this + if (!forcestrafe && (((movefkey || movebkey) && side) || ((strafelkey || straferkey) && forward))) { forward = FixedMul(forward, 3*FRACUNIT/4); side = FixedMul(side, 3*FRACUNIT/4);