From 2d54bb7356f72af987e695973f0406decaa92325 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=CE=B6eh=20Matt?= <5415177+ZehMatt@users.noreply.github.com> Date: Thu, 31 Oct 2024 18:39:44 +0200 Subject: [PATCH] Remove networking of velocity for animations, this is done by GMod now --- gamemode/sh_animations.lua | 21 --------------------- gamemode/sh_lambda_player.lua | 1 - 2 files changed, 22 deletions(-) diff --git a/gamemode/sh_animations.lua b/gamemode/sh_animations.lua index cb1c033c..8fa21454 100644 --- a/gamemode/sh_animations.lua +++ b/gamemode/sh_animations.lua @@ -6,26 +6,7 @@ local CurTime = CurTime local Vector = Vector local math = math local IsValid = IsValid -local engine = engine --local DbgPrint = GetLogging("Animation") -local engineTick = engine.TickInterval() - -local function GetPlayerVelocity(ply, velocity) - if CLIENT and ply ~= LocalPlayer() then - velocity = ply:GetNWVector("LambdaVelocity", velocity) - ply.InterpolatedVelocity = ply.InterpolatedVelocity or Vector(0, 0, 0) - - if velocity:Distance(ply.InterpolatedVelocity) > 10 then - ply.InterpolatedVelocity = velocity - else - ply.InterpolatedVelocity = LerpVector(engineTick * 2.0, ply.InterpolatedVelocity, velocity) - end - - return ply.InterpolatedVelocity - end - - return velocity -end function GM:HandlePlayerJumping(ply, velocity) if (ply:GetMoveType() == MOVETYPE_NOCLIP) then @@ -203,7 +184,6 @@ Name: gamemode:UpdateAnimation() Desc: Animation updates (pose params etc) should be done here -----------------------------------------------------------]] function GM:UpdateAnimation(ply, velocity, maxseqgroundspeed) - velocity = GetPlayerVelocity(ply, velocity) local len = velocity:Length() local movement = len / maxseqgroundspeed local rate = math.min(movement, 2) @@ -285,7 +265,6 @@ end function GM:CalcMainActivity(ply, velocity) ply.CalcIdeal = ACT_MP_STAND_IDLE ply.CalcSeqOverride = -1 - velocity = GetPlayerVelocity(ply, velocity) self:HandlePlayerLanding(ply, velocity, ply.m_bWasOnGround) local isHandled = self:HandlePlayerNoClipping(ply, velocity) or self:HandlePlayerDriving(ply) or self:HandlePlayerVaulting(ply, velocity) or self:HandlePlayerJumping(ply, velocity) or self:HandlePlayerSwimming(ply, velocity) or self:HandlePlayerDucking(ply, velocity) diff --git a/gamemode/sh_lambda_player.lua b/gamemode/sh_lambda_player.lua index a758a45b..4d155e7c 100644 --- a/gamemode/sh_lambda_player.lua +++ b/gamemode/sh_lambda_player.lua @@ -1349,7 +1349,6 @@ function GM:PlayerTick(ply, mv) self:LimitPlayerAmmo(ply) self:PlayerCheckDrowning(ply) if ply:GetNWBool("LambdaHEVSuit", false) ~= ply:IsSuitEquipped() then ply:SetNWBool("LambdaHEVSuit", ply:IsSuitEquipped()) end - ply:SetNWVector("LambdaVelocity", ply:GetVelocity()) end end