Skip to content

Commit

Permalink
fix: resetting walkstyle to crouch (#1)
Browse files Browse the repository at this point in the history
The issue as described in issue #1 is that the walkstyle get's reset back but before it's applied it collects your walkstyle again (which is crouched) and then saves that for next time you exit crouch. The fix is to not be able to save move_ped_crouched as your walkstyle and not overwriting the saved walkstyle if the new one is nil.
  • Loading branch information
MadsLeander committed Feb 21, 2023
1 parent 4b3f094 commit 7a76210
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion client.lua
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ local function StartCrouch()
SetFollowPedCamViewMode(0) -- THIRD_PERSON_NEAR
end

walkstyle = GetPedWalkstyle(playerPed)
walkstyle = GetPedWalkstyle(playerPed) or walkstyle
SetPedMovementClipset(playerPed, "move_ped_crouched", 0.6)
SetPedStrafeClipset(playerPed, "move_ped_crouched_strafing")

Expand Down
2 changes: 1 addition & 1 deletion walkstyles.lua
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ local walkStyles = {
[-59928421] = "move_m@business@c",
[-2055591238] = "move_chubby",
[-108537538] = "move_f@chubby@a",
[-1155413492] = "move_ped_crouched",
-- [-1155413492] = "move_ped_crouched", -- Don't uncomment this.
[-1401903942] = "move_f@multiplayer",
[1113513977] = "move_m@multiplayer",
[-1287120285] = "move_m@depressed@a",
Expand Down

0 comments on commit 7a76210

Please sign in to comment.