From 6bbab427a9d6f73c2b02f132463b6eb04e794676 Mon Sep 17 00:00:00 2001 From: "Jonny_Bro (Nikita)" Date: Thu, 5 Sep 2024 18:32:04 +0500 Subject: [PATCH] fix jump off on "slippery" places --- .../beatrun/entities/entities/br_laser/shared.lua | 7 +++---- .../beatrun/entities/weapons/runnerhands/shared.lua | 13 ++++++------- .../gamemodes/beatrun/gamemode/sh/FreerunSysAll.lua | 11 +++++------ beatrun/gamemodes/beatrun/gamemode/sh/Melee.lua | 13 ++++++------- beatrun/gamemodes/beatrun/gamemode/sh/Sliding.lua | 12 +++++------- 5 files changed, 25 insertions(+), 31 deletions(-) diff --git a/beatrun/gamemodes/beatrun/entities/entities/br_laser/shared.lua b/beatrun/gamemodes/beatrun/entities/entities/br_laser/shared.lua index 806098c..aaf6f40 100644 --- a/beatrun/gamemodes/beatrun/entities/entities/br_laser/shared.lua +++ b/beatrun/gamemodes/beatrun/entities/entities/br_laser/shared.lua @@ -63,10 +63,9 @@ function ENT:BRCollisionFunc(ent) if util.QuickTrace(self:GetPos(), ang:Up() * self.LaserLength, self).Entity ~= ent then return false end local dmginfo = DamageInfo() - dmginfo:SetAttacker(self) - dmginfo:SetDamage(1000) - dmginfo:SetDamageType(DMG_DISSOLVE) - + dmginfo:SetAttacker(self) + dmginfo:SetDamage(1000) + dmginfo:SetDamageType(DMG_DISSOLVE) ent:TakeDamageInfo(dmginfo) ent:EmitSound("bigspark" .. math.random(1, 2) .. ".wav") diff --git a/beatrun/gamemodes/beatrun/entities/weapons/runnerhands/shared.lua b/beatrun/gamemodes/beatrun/entities/weapons/runnerhands/shared.lua index a34c025..a7d88f6 100644 --- a/beatrun/gamemodes/beatrun/entities/weapons/runnerhands/shared.lua +++ b/beatrun/gamemodes/beatrun/entities/weapons/runnerhands/shared.lua @@ -495,13 +495,12 @@ function SWEP:PrimaryAttack() if SERVER and IsValid(ent) then if not ply:IsPlayer() or (Course_Name == "" and not GetGlobalBool("GM_INFECTION")) then local d = DamageInfo() - d:SetDamage((punch ~= 3 and 10) or 20) - d:SetAttacker(ply) - d:SetInflictor(self) - d:SetDamageType(DMG_CLUB) - d:SetDamagePosition(tr.start) - d:SetDamageForce(ply:EyeAngles():Forward() * 7000) - + d:SetDamage((punch ~= 3 and 10) or 20) + d:SetAttacker(ply) + d:SetInflictor(self) + d:SetDamageType(DMG_CLUB) + d:SetDamagePosition(tr.start) + d:SetDamageForce(ply:EyeAngles():Forward() * 7000) ent:TakeDamageInfo(d) if ent:IsNPC() then diff --git a/beatrun/gamemodes/beatrun/gamemode/sh/FreerunSysAll.lua b/beatrun/gamemodes/beatrun/gamemode/sh/FreerunSysAll.lua index 59463a5..e43c732 100644 --- a/beatrun/gamemodes/beatrun/gamemode/sh/FreerunSysAll.lua +++ b/beatrun/gamemodes/beatrun/gamemode/sh/FreerunSysAll.lua @@ -196,15 +196,14 @@ hook.Add("OnPlayerHitGround", "MELandSound", function(ply, water, floater, speed end if SERVER and speed >= 500 and ply:GetJumpTurn() then - local info = DamageInfo() local dmg = ply:Health() * 0.1 if ply:Health() - dmg > 0 then - info:SetDamage(dmg) - info:SetDamageType(DMG_FALL) - info:SetAttacker(game.GetWorld()) - info:SetInflictor(game.GetWorld()) - + local info = DamageInfo() + info:SetDamage(dmg) + info:SetDamageType(DMG_FALL) + info:SetAttacker(game.GetWorld()) + info:SetInflictor(game.GetWorld()) ply:TakeDamageInfo(info) end end diff --git a/beatrun/gamemodes/beatrun/gamemode/sh/Melee.lua b/beatrun/gamemodes/beatrun/gamemode/sh/Melee.lua index e304939..e1d109a 100644 --- a/beatrun/gamemodes/beatrun/gamemode/sh/Melee.lua +++ b/beatrun/gamemodes/beatrun/gamemode/sh/Melee.lua @@ -191,13 +191,12 @@ local function MeleeThink(ply, mv, cmd) if SERVER and IsValid(ent) and (not ent:IsPlayer() or Course_Name == "" and not GetGlobalBool("GM_INFECTION") and GetConVar("sbox_playershurtplayers"):GetBool()) then local d = DamageInfo() - d:SetDamage(meleedata[ply:GetMelee()][6]) - d:SetAttacker(ply) - d:SetInflictor(ply) - d:SetDamageType(DMG_CLUB) - d:SetDamagePosition(tr.start) - d:SetDamageForce(ply:EyeAngles():Forward() * 7000) - + d:SetDamage(meleedata[ply:GetMelee()][6]) + d:SetAttacker(ply) + d:SetInflictor(ply) + d:SetDamageType(DMG_CLUB) + d:SetDamagePosition(tr.start) + d:SetDamageForce(ply:EyeAngles():Forward() * 7000) ent:TakeDamageInfo(d) if SERVER and ent:GetClass() == "func_breakable_surf" then diff --git a/beatrun/gamemodes/beatrun/gamemode/sh/Sliding.lua b/beatrun/gamemodes/beatrun/gamemode/sh/Sliding.lua index 5800a0e..03e8bf2 100644 --- a/beatrun/gamemodes/beatrun/gamemode/sh/Sliding.lua +++ b/beatrun/gamemodes/beatrun/gamemode/sh/Sliding.lua @@ -321,12 +321,10 @@ hook.Add("SetupMove", "qslide", function(ply, mv, cmd) ply:SetCrouchJump(false) - if SERVER and mv:GetVelocity().z <= -1250 then + if SERVER and mv:GetVelocity().z <= -1250 and not ply:InOverdrive() then local dmg = DamageInfo() - - dmg:SetDamageType(DMG_FALL) - dmg:SetDamage(1000) - + dmg:SetDamageType(DMG_FALL) + dmg:SetDamage(1000) ply:TakeDamageInfo(dmg) end end @@ -520,8 +518,8 @@ hook.Add("SetupMove", "qslide", function(ply, mv, cmd) if not slippery and pos.z > ply:GetSlidingLastPos().z + 1 then ply:SetSlidingTime(ply:GetSlidingTime() - 0.025) elseif slippery or slidedelta < 1 and pos.z < ply:GetSlidingLastPos().z - 0.25 then - ply:SetSlidingTime(CT + slidetime) --[[ 450 * ply:GetOverdriveMult() ]] - ply:SetSlidingVel(math.min(mv:GetVelocity():Length() * 0.865, GetConVar("Beatrun_SpeedLimit"):GetInt() * 2) * ply:GetOverdriveMult()) + ply:SetSlidingTime(CT + slidetime) --[[ GetConVar("Beatrun_SpeedLimit"):GetInt() ]] + ply:SetSlidingVel(math.min(mv:GetVelocity():Length() * 0.865, 450 * ply:GetOverdriveMult())) end ply:SetSlidingLastPos(pos)