Skip to content

Commit e9c867f

Browse files
gunslingermodXottab-DUTY
authored andcommitted
[Bugfix] Lookout feature starts working incorrectly if user tries to 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.
1 parent cc83e24 commit e9c867f

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

src/xrGame/Actor_Movement.cpp

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,10 +36,21 @@ IC static void generate_orthonormal_basis1(const Fvector& dir, Fvector& updir, F
3636
void CActor::g_cl_ValidateMState(float dt, u32 mstate_wf)
3737
{
3838
// Lookout
39-
if (mstate_wf & mcLookout)
39+
if ((mstate_wf & mcLLookout) && (mstate_wf & mcRLookout))
40+
{
41+
// It's impossible to perform right and left lookouts in the same time
42+
mstate_real &= ~mcLookout;
43+
}
44+
else if (mstate_wf & mcLookout)
45+
{
46+
// Activate one of lookouts
4047
mstate_real |= mstate_wf & mcLookout;
48+
}
4149
else
50+
{
51+
// No lookouts needed
4252
mstate_real &= ~mcLookout;
53+
}
4354

4455
if (mstate_real & (mcJump | mcFall | mcLanding | mcLanding2))
4556
mstate_real &= ~mcLookout;

0 commit comments

Comments
 (0)