mirror of
https://git.do.srb2.org/STJr/SRB2.git
synced 2024-11-18 02:21:47 +00:00
Whoops, forgot P2
This commit is contained in:
parent
e020352c0c
commit
d1e379f4f9
1 changed files with 13 additions and 6 deletions
19
src/g_game.c
19
src/g_game.c
|
@ -1288,7 +1288,7 @@ void G_BuildTiccmd2(ticcmd_t *cmd, INT32 realtics)
|
||||||
INT32 tspeed, forward, side, axis, i;
|
INT32 tspeed, forward, side, axis, i;
|
||||||
const INT32 speed = 1;
|
const INT32 speed = 1;
|
||||||
// these ones used for multiple conditions
|
// 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];
|
player_t *player = &players[secondarydisplayplayer];
|
||||||
camera_t *thiscam = (player->bot == 2 ? &camera : &camera2);
|
camera_t *thiscam = (player->bot == 2 ? &camera : &camera2);
|
||||||
|
|
||||||
|
@ -1309,6 +1309,12 @@ void G_BuildTiccmd2(ticcmd_t *cmd, INT32 realtics)
|
||||||
|
|
||||||
turnright = PLAYER2INPUTDOWN(gc_turnright);
|
turnright = PLAYER2INPUTDOWN(gc_turnright);
|
||||||
turnleft = PLAYER2INPUTDOWN(gc_turnleft);
|
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;
|
mouseaiming = (PLAYER2INPUTDOWN(gc_mouseaiming)) ^ cv_alwaysfreelook2.value;
|
||||||
analogjoystickmove = cv_usejoystick2.value && !Joystick2.bGamepadStyle;
|
analogjoystickmove = cv_usejoystick2.value && !Joystick2.bGamepadStyle;
|
||||||
gamepadjoystickmove = 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
|
// forward with key or button
|
||||||
axis = Joy2Axis(AXISMOVE);
|
axis = Joy2Axis(AXISMOVE);
|
||||||
if (PLAYER2INPUTDOWN(gc_forward) || (gamepadjoystickmove && axis < 0))
|
if (movefkey || (gamepadjoystickmove && axis < 0))
|
||||||
forward = forwardmove[speed];
|
forward = forwardmove[speed];
|
||||||
if (PLAYER2INPUTDOWN(gc_backward) || (gamepadjoystickmove && axis > 0))
|
if (movebkey || (gamepadjoystickmove && axis > 0))
|
||||||
forward -= forwardmove[speed];
|
forward -= forwardmove[speed];
|
||||||
|
|
||||||
if (analogjoystickmove && axis != 0)
|
if (analogjoystickmove && axis != 0)
|
||||||
|
@ -1407,9 +1413,9 @@ void G_BuildTiccmd2(ticcmd_t *cmd, INT32 realtics)
|
||||||
|
|
||||||
// some people strafe left & right with mouse buttons
|
// some people strafe left & right with mouse buttons
|
||||||
// those people are (still) weird
|
// those people are (still) weird
|
||||||
if (PLAYER2INPUTDOWN(gc_straferight))
|
if (straferkey)
|
||||||
side += sidemove[speed];
|
side += sidemove[speed];
|
||||||
if (PLAYER2INPUTDOWN(gc_strafeleft))
|
if (strafelkey)
|
||||||
side -= sidemove[speed];
|
side -= sidemove[speed];
|
||||||
|
|
||||||
if (PLAYER2INPUTDOWN(gc_weaponnext))
|
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.
|
// 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.
|
// 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);
|
forward = FixedMul(forward, 3*FRACUNIT/4);
|
||||||
side = FixedMul(side, 3*FRACUNIT/4);
|
side = FixedMul(side, 3*FRACUNIT/4);
|
||||||
|
|
Loading…
Reference in a new issue