From d1e379f4f9c2369e262dd5863752fdcdda838287 Mon Sep 17 00:00:00 2001 From: TehRealSalt Date: Tue, 19 Sep 2017 00:30:08 -0400 Subject: [PATCH] Whoops, forgot P2 --- src/g_game.c | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/src/g_game.c b/src/g_game.c index a087a0ad6..95b7b8890 100644 --- a/src/g_game.c +++ b/src/g_game.c @@ -1288,7 +1288,7 @@ void G_BuildTiccmd2(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[secondarydisplayplayer]; camera_t *thiscam = (player->bot == 2 ? &camera : &camera2); @@ -1309,6 +1309,12 @@ void G_BuildTiccmd2(ticcmd_t *cmd, INT32 realtics) turnright = PLAYER2INPUTDOWN(gc_turnright); turnleft = PLAYER2INPUTDOWN(gc_turnleft); + + straferkey = PLAYER2INPUTDOWN(gc_straferight); + strafelkey = PLAYER2INPUTDOWN(gc_strafeleft); + movefkey = PLAYER2INPUTDOWN(gc_forward); + movebkey = PLAYER2INPUTDOWN(gc_backward); + mouseaiming = (PLAYER2INPUTDOWN(gc_mouseaiming)) ^ cv_alwaysfreelook2.value; analogjoystickmove = cv_usejoystick2.value && !Joystick2.bGamepadStyle; gamepadjoystickmove = cv_usejoystick2.value && Joystick2.bGamepadStyle; @@ -1397,9 +1403,9 @@ void G_BuildTiccmd2(ticcmd_t *cmd, INT32 realtics) // forward with key or button axis = Joy2Axis(AXISMOVE); - if (PLAYER2INPUTDOWN(gc_forward) || (gamepadjoystickmove && axis < 0)) + if (movefkey || (gamepadjoystickmove && axis < 0)) forward = forwardmove[speed]; - if (PLAYER2INPUTDOWN(gc_backward) || (gamepadjoystickmove && axis > 0)) + if (movebkey || (gamepadjoystickmove && axis > 0)) forward -= forwardmove[speed]; if (analogjoystickmove && axis != 0) @@ -1407,9 +1413,9 @@ void G_BuildTiccmd2(ticcmd_t *cmd, INT32 realtics) // some people strafe left & right with mouse buttons // those people are (still) weird - if (PLAYER2INPUTDOWN(gc_straferight)) + if (straferkey) side += sidemove[speed]; - if (PLAYER2INPUTDOWN(gc_strafeleft)) + if (strafelkey) side -= sidemove[speed]; if (PLAYER2INPUTDOWN(gc_weaponnext)) @@ -1543,7 +1549,8 @@ void G_BuildTiccmd2(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);