- SW: Fix turn scaling while pp->sop_control and specify !pp->sop to processMovement()s allowstrafe bool instead of an unconditional true.

This commit is contained in:
Mitchell Richters 2020-09-25 22:17:21 +10:00
parent c8a74a8f3f
commit 73f52b2cee
3 changed files with 6 additions and 7 deletions

View file

@ -1494,10 +1494,9 @@ fixed_t getincangleq16(fixed_t a, fixed_t na)
//
//---------------------------------------------------------------------------
void processMovement(InputPacket* currInput, InputPacket* inputBuffer, ControlInfo* const hidInput, bool const allowstrafe, double const scaleAdjust, int const turnscale, short const drink_amt)
void processMovement(InputPacket* currInput, InputPacket* inputBuffer, ControlInfo* const hidInput, bool const allowstrafe, double const scaleAdjust, double const turnscale, short const drink_amt)
{
// set up variables
bool const mouseaim = !(inputBuffer->actions & SB_AIMMODE);
int const running = !!(inputBuffer->actions & SB_RUN);
int const keymove = gi->playerKeyMove() << running;
int const mousevelscale = g_gameType & GAMEFLAG_BLOOD ? 32 : 4;
@ -1509,7 +1508,7 @@ void processMovement(InputPacket* currInput, InputPacket* inputBuffer, ControlIn
else
currInput->q16avel += FloatToFixed(hidInput->mousex + (scaleAdjust * hidInput->dyaw));
if (mouseaim)
if (!(inputBuffer->actions & SB_AIMMODE))
currInput->q16horz -= FloatToFixed(hidInput->mousey);
else
currInput->fvel -= xs_CRoundToInt(hidInput->mousey * mousevelscale * 2);
@ -1519,8 +1518,8 @@ void processMovement(InputPacket* currInput, InputPacket* inputBuffer, ControlIn
// process remaining controller input.
currInput->q16horz -= FloatToFixed(scaleAdjust * hidInput->dpitch);
currInput->svel -= xs_CRoundToInt(scaleAdjust * (hidInput->dx * keymove * cntrlvelscale));
currInput->fvel -= xs_CRoundToInt(scaleAdjust * (hidInput->dz * keymove * cntrlvelscale));
currInput->svel -= xs_CRoundToInt(scaleAdjust * hidInput->dx * keymove * cntrlvelscale);
currInput->fvel -= xs_CRoundToInt(scaleAdjust * hidInput->dz * keymove * cntrlvelscale);
// process keyboard turning keys.
if (buttonMap.ButtonDown(gamefunc_Strafe) && allowstrafe)

View file

@ -67,7 +67,7 @@ void CompleteLevel(MapRecord* map);
int getincangle(int c, int n);
fixed_t getincangleq16(fixed_t c, fixed_t n);
void processMovement(InputPacket* currInput, InputPacket* inputBuffer, ControlInfo* const hidInput, bool const allowstrafe, double const scaleAdjust, int const turnscale = 1, short const drink_amt = 0);
void processMovement(InputPacket* currInput, InputPacket* inputBuffer, ControlInfo* const hidInput, bool const allowstrafe, double const scaleAdjust, double const turnscale = 1, short const drink_amt = 0);
void sethorizon(fixed_t* q16horiz, fixed_t const q16horz, ESyncBits* actions, double const scaleAdjust);
void applylook(fixed_t* q16ang, fixed_t* q16look_ang, fixed_t* q16rotscrnang, fixed_t* spin, fixed_t const q16avel, ESyncBits* actions, double const scaleAdjust, bool const crouching);
void playerAddAngle(fixed_t* q16ang, double* helper, double adjustment);

View file

@ -205,7 +205,7 @@ void GameInterface::GetInput(InputPacket *packet, ControlInfo* const hidInput)
PLAYERp pp = &Player[myconnectindex];
processInputBits(pp, hidInput);
processMovement(&input, &loc, hidInput, true, scaleAdjust, pp->sop_control ? 3 : 1);
processMovement(&input, &loc, hidInput, !pp->sop, scaleAdjust, pp->sop_control ? 3. / 1.40625 : 1.);
processWeapon(pp);
if (!cl_syncinput)