Skip to content

Commit

Permalink
[Bugfix] Lookout feature starts working incorrectly if user tries to …
Browse files Browse the repository at this point in the history
…activate both lookouts simultaneously

The mstate_real activates both leaft and right lookout flags if user press keys simultaneously. Flags won't be clear until user releases both keys, so lookouts won't work properly.
  • Loading branch information
gunslingermod authored and Xottab-DUTY committed Aug 14, 2017
1 parent cc83e24 commit e9c867f
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion src/xrGame/Actor_Movement.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -36,10 +36,21 @@ IC static void generate_orthonormal_basis1(const Fvector& dir, Fvector& updir, F
void CActor::g_cl_ValidateMState(float dt, u32 mstate_wf)
{
// Lookout
if (mstate_wf & mcLookout)
if ((mstate_wf & mcLLookout) && (mstate_wf & mcRLookout))
{
// It's impossible to perform right and left lookouts in the same time
mstate_real &= ~mcLookout;
}
else if (mstate_wf & mcLookout)
{
// Activate one of lookouts
mstate_real |= mstate_wf & mcLookout;
}
else
{
// No lookouts needed
mstate_real &= ~mcLookout;
}

if (mstate_real & (mcJump | mcFall | mcLanding | mcLanding2))
mstate_real &= ~mcLookout;
Expand Down

0 comments on commit e9c867f

Please sign in to comment.