Skip to content

Commit

Permalink
Remove conflicting stealth check
Browse files Browse the repository at this point in the history
Removed check that blocked users from moving from stealth mode to crouch. This block seems to have initially put in to stop users from going into crouch when stealth mode with different keybinds? Unsure, but seems to conflict with actual use cases.
  • Loading branch information
alberttheprince authored Jul 31, 2024
1 parent 7cd262a commit 5639158
Showing 1 changed file with 0 additions and 14 deletions.
14 changes: 0 additions & 14 deletions client/Crouch.lua
Original file line number Diff line number Diff line change
Expand Up @@ -153,20 +153,6 @@ local function CrouchKeyPressed()
if crouchKey == lookBehindKey then
DisableControlUntilReleased(0, 26) -- INPUT_LOOK_BEHIND
end

-- If they are the same and we aren't prone, then check if we are in stealth mode and how long ago the last button press was.
if crouchKey == duckKey and not IsProne then
local timer = GetGameTimer()

-- If we are in stealth mode and we have already pressed the button in the last second
if GetPedStealthMovement(playerPed) == 1 and timer - lastKeyPress < 1000 then
DisableControlAction(0, 36, true) -- Disable INPUT_DUCK this frame
lastKeyPress = 0
else
lastKeyPress = timer
return
end
end
end

-- Start to crouch
Expand Down

0 comments on commit 5639158

Please sign in to comment.