-
-
Notifications
You must be signed in to change notification settings - Fork 530
Fix for the crouch key behavior #4539
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -3122,14 +3122,10 @@ void CClientPed::ApplyControllerStateFixes(CControllerState& Current) | |
| // Disable the fire keys whilst crouching as well | ||
| Current.ButtonCircle = 0; | ||
| Current.LeftShoulder1 = 0; | ||
| if (m_ulLastTimeBeganCrouch >= ulNow - 400.0f * fSpeedRatio) | ||
| { | ||
| // Disable double crouching (another anim cut) | ||
| if (g_pClientGame->IsUsingAlternatePulseOrder()) | ||
| Current.ShockButtonL = 255; // Do this differently if we have changed the pulse order | ||
| else | ||
| Current.ShockButtonL = 0; | ||
| } | ||
|
|
||
| // Disable double crouching (another anim cut) | ||
| if (ulNow - m_ulLastTimeBeganCrouch < 500 * fSpeedRatio) | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 👍 is equivalent to But can you explain the change from Why did you change this?
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. btw I think your new code is clearer so you should change line 3115 too |
||
| Current.ShockButtonL = IsDucked() ? 255 : 0; | ||
| } | ||
| } | ||
| // If we just started aiming, make sure they dont try and crouch | ||
|
|
@@ -7269,4 +7265,3 @@ void CClientPed::RunSwimTask() const | |
|
|
||
| inWaterTask->SetAsPedTask(m_pPlayerPed, TASK_PRIORITY_EVENT_RESPONSE_NONTEMP, true); | ||
| } | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't really know how alternate pulse order works but it looks like this code was introduced here: cd9473b
According to https://web.archive.org/web/20200809114050/https://bugs.mtasa.com/view.php?id=7250
However those repro steps will not work today because the implementation of
IsUsingAlternatePulseOrderhas changed.Today,
IsUsingAlternatePulseOrderis managed by thelatency_reductionsetting (default 0).Please can you confirm that this code does not break crouching when using
<latency_reduction>1</latency_reduction>?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am testing this now
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Which means that your patch works with any
latency_reductionstate, great.But we should also test to make sure we've haven't reintroduced this exploit:
mtasa-blue/Client/mods/deathmatch/logic/CClientPed.cpp
Lines 3108 to 3112 in a665e01
Does anyone know how to trigger this exploit?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Found info on https://gta.fandom.com/wiki/Desert_Eagle
I can't test this right now but someone should test to make sure we haven't unintentionally restored that exploit