CrouchJump will not work if noclip is activated, so no more camera locks in build mode!

This commit is contained in:
shen 2024-06-07 11:35:12 +03:00
parent 7e44199ce9
commit 74a9f6de4c

View file

@ -8,6 +8,10 @@ elseif CLIENT and game.SinglePlayer() then
net.Receive("CrouchJumpSP", function()
local ply = LocalPlayer()
if ply:GetMoveType() == MOVETYPE_NOCLIP then
return
end
if BodyAnimArmCopy then
BodyAnimCycle = 0
BodyAnimCrouchLerp = 0
@ -29,6 +33,10 @@ hook.Add("SetupMove", "CrouchJump", function(ply, mv, cmd)
ply:SetCrouchJumpBlocked(false)
end
if ply:GetMoveType() == MOVETYPE_NOCLIP then
return
end
local activewep = ply:GetActiveWeapon()
if ply:Alive() and not ply:GetCrouchJumpBlocked() and not IsValid(ply:GetZipline()) and not IsValid(ply:GetLadder()) and ply:GetClimbing() == 0 and not ply:GetJumpTurn() and ply:GetMantle() == 0 and not ply:OnGround() and ply:GetVelocity().z > -350 and ply:GetCrouchJumpTime() < CurTime() and ply:GetWallrun() == 0 and mv:KeyPressed(IN_DUCK) then