Skip to content

Commit

Permalink
Fixed issues with Actor crouch mode
Browse files Browse the repository at this point in the history
  • Loading branch information
Xottab-DUTY committed Sep 1, 2019
1 parent c1a1d06 commit f8424c4
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion src/xrGame/Actor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1233,7 +1233,7 @@ void CActor::shedule_Update(u32 DT)
mstate_wishful &= ~mcFwd;
mstate_wishful &= ~mcBack;
extern bool g_bAutoClearCrouch;
if (!psActorFlags.test(AF_CROUCH_TOGGLE) || g_bAutoClearCrouch)
if (g_bAutoClearCrouch)
mstate_wishful &= ~mcCrouch;
}
}
Expand Down
10 changes: 5 additions & 5 deletions src/xrGame/ActorInput.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -107,12 +107,11 @@ void CActor::IR_OnKeyboardPress(int cmd)
}
break;
case kCROUCH_TOGGLE:
if (!psActorFlags.test(AF_CROUCH_TOGGLE))
g_bAutoClearCrouch = !g_bAutoClearCrouch;
[[fallthrough]];
case kCROUCH:
{
if (psActorFlags.test(AF_CROUCH_TOGGLE) || !g_bAutoClearCrouch)
if (psActorFlags.test(AF_CROUCH_TOGGLE) || cmd == kCROUCH_TOGGLE)
g_bAutoClearCrouch = !g_bAutoClearCrouch;
if (!g_bAutoClearCrouch)
mstate_wishful ^= mcCrouch;
}
break;
Expand Down Expand Up @@ -267,7 +266,8 @@ void CActor::IR_OnKeyboardRelease(int cmd)
g_PerformDrop();
break;
case kCROUCH:
g_bAutoClearCrouch = true;
if (!psActorFlags.test(AF_CROUCH_TOGGLE))
g_bAutoClearCrouch = true;
break;
}
}
Expand Down

0 comments on commit f8424c4

Please sign in to comment.