Commit 8d56442a authored by Dino Bollinger's avatar Dino Bollinger
Browse files

Duke3D: Update input struct horz and avel even when player movement is locked

This is intended to restore compatibility with older mods that relied on this behavior.
Examples for this are: cursors on menu systems, controllable cameras
parent 437e61ef
......@@ -3273,7 +3273,6 @@ void P_GetInput(int const playerNum)
}
localInput.fvel = localInput.svel = 0;
localInput.q16avel = localInput.q16horz = 0;
}
else
{
......@@ -3284,18 +3283,16 @@ void P_GetInput(int const playerNum)
}
if (!(movementLocked & IL_NOANGLE))
{
localInput.q16avel = fix16_sadd(localInput.q16avel, input.q16avel);
pPlayer->q16ang = fix16_sadd(pPlayer->q16ang, input.q16avel) & 0x7FFFFFF;
}
if (!(movementLocked & IL_NOHORIZ))
{
localInput.q16horz = fix16_clamp(fix16_sadd(localInput.q16horz, input.q16horz), F16(-MAXHORIZVEL), F16(MAXHORIZVEL));
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);
// A horiz diff of 128 equal 45 degrees, so we convert horiz to 1024 angle units
if (thisPlayer.horizAngleAdjust)
......
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