Whoops, forgot P2

This commit is contained in:
TehRealSalt 2017-09-19 00:30:08 -04:00
parent e020352c0c
commit d1e379f4f9

View file

@ -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);