Commit 764938c2 authored by Dino Bollinger's avatar Dino Bollinger
Browse files

Revise previous commit because it was faulty

parent 8d56442a
......@@ -3262,20 +3262,19 @@ void P_GetInput(int const playerNum)
localInput.extbits |= BUTTON(gamefunc_Turn_Right)<<5;
localInput.extbits |= BUTTON(gamefunc_Alt_Fire)<<6;
int const movementLocked = P_CheckLockedMovement(playerNum);
if ((ud.scrollmode && ud.overhead_on) || (movementLocked & IL_NOTHING) == IL_NOTHING)
if (ud.scrollmode && ud.overhead_on)
{
if (ud.scrollmode && ud.overhead_on)
{
ud.folfvel = input.fvel;
ud.folavel = fix16_to_int(input.q16avel);
}
ud.folfvel = input.fvel;
ud.folavel = fix16_to_int(input.q16avel);
localInput.fvel = localInput.svel = 0;
localInput.q16avel = localInput.q16horz = 0;
}
else
{
int const movementLocked = P_CheckLockedMovement(playerNum);
if (!(movementLocked & IL_NOMOVE))
{
localInput.fvel = clamp(localInput.fvel + input.fvel, -MAXVEL, MAXVEL);
......@@ -3287,11 +3286,10 @@ void P_GetInput(int const playerNum)
if (!(movementLocked & IL_NOHORIZ))
pPlayer->q16horiz = fix16_clamp(fix16_sadd(pPlayer->q16horiz, input.q16horz), F16(HORIZ_MIN), F16(HORIZ_MAX));
}
// Always update input struct such that movement can be used in scripts even when the player himself can't move
localInput.q16horz = fix16_clamp(fix16_sadd(localInput.q16horz, input.q16horz), F16(-MAXHORIZVEL), F16(MAXHORIZVEL));
localInput.q16avel = fix16_sadd(localInput.q16avel, input.q16avel);
localInput.q16horz = fix16_clamp(fix16_sadd(localInput.q16horz, input.q16horz), F16(-MAXHORIZVEL), F16(MAXHORIZVEL));
localInput.q16avel = fix16_sadd(localInput.q16avel, input.q16avel);
}
// A horiz diff of 128 equal 45 degrees, so we convert horiz to 1024 angle units
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment