mirror of
https://github.com/JonnyBro/beatrun.git
synced 2024-12-27 20:43:02 +05:00
fix jump off on "slippery" places
This commit is contained in:
parent
6169712625
commit
6bbab427a9
5 changed files with 25 additions and 31 deletions
|
@ -66,7 +66,6 @@ function ENT:BRCollisionFunc(ent)
|
|||
dmginfo:SetAttacker(self)
|
||||
dmginfo:SetDamage(1000)
|
||||
dmginfo:SetDamageType(DMG_DISSOLVE)
|
||||
|
||||
ent:TakeDamageInfo(dmginfo)
|
||||
ent:EmitSound("bigspark" .. math.random(1, 2) .. ".wav")
|
||||
|
||||
|
|
|
@ -501,7 +501,6 @@ function SWEP:PrimaryAttack()
|
|||
d:SetDamageType(DMG_CLUB)
|
||||
d:SetDamagePosition(tr.start)
|
||||
d:SetDamageForce(ply:EyeAngles():Forward() * 7000)
|
||||
|
||||
ent:TakeDamageInfo(d)
|
||||
|
||||
if ent:IsNPC() then
|
||||
|
|
|
@ -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
|
||||
local info = DamageInfo()
|
||||
info:SetDamage(dmg)
|
||||
info:SetDamageType(DMG_FALL)
|
||||
info:SetAttacker(game.GetWorld())
|
||||
info:SetInflictor(game.GetWorld())
|
||||
|
||||
ply:TakeDamageInfo(info)
|
||||
end
|
||||
end
|
||||
|
|
|
@ -197,7 +197,6 @@ local function MeleeThink(ply, mv, cmd)
|
|||
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
|
||||
|
|
|
@ -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)
|
||||
|
||||
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)
|
||||
|
|
Loading…
Reference in a new issue