clientside firing animations, actually clamp playbackrate

This commit is contained in:
TheOnly8Z 2021-04-21 20:02:48 +08:00
parent e659be3d4c
commit efaa247d42
2 changed files with 3 additions and 3 deletions

View File

@ -222,12 +222,12 @@ function SWEP:PlayAnimation(key, mult, pred, startfrom, tt, skipholster, ignorer
timer.Simple(0, function()
vm:SendViewModelMatchingSequence(seq)
local dur = vm:SequenceDuration()
vm:SetPlaybackRate(math.Clamp(dur / (ttime + startfrom), 0, 10))
vm:SetPlaybackRate(math.Clamp(dur / (ttime + startfrom), -4, 12))
end)
else
vm:SendViewModelMatchingSequence(seq)
local dur = vm:SequenceDuration()
vm:SetPlaybackRate(math.Clamp(dur / (ttime + startfrom), 0, 10))
vm:SetPlaybackRate(math.Clamp(dur / (ttime + startfrom), -4, 12))
self.LastAnimStartTime = CurTime()
self.LastAnimFinishTime = CurTime() + (dur * mult)
end

View File

@ -506,7 +506,7 @@ function SWEP:DoPrimaryAnim()
local time = self:GetBuff_Mult("Mult_FireAnimTime", anim) or 1
if anim then self:PlayAnimation(anim, time, true, 0, false) end
if anim and (CLIENT or game.SinglePlayer()) then self:PlayAnimation(anim, time, true, 0, false) end
end
function SWEP:DoPenetration(tr, penleft, alreadypenned)