mirror of
https://github.com/JonnyBro/beatrun.git
synced 2024-12-27 20:43:02 +05:00
get rid of ambiguity in a dumb if statement
This commit is contained in:
parent
a077069648
commit
cb0a44369e
17 changed files with 9 additions and 62 deletions
|
@ -70,17 +70,6 @@ local function DrawDebugInfo()
|
|||
end
|
||||
|
||||
local counter = 0
|
||||
|
||||
surface.SetTextColor(255, 255, 255, 255)
|
||||
surface.SetTextPos(100, 100)
|
||||
surface.DrawText("Removing Control:")
|
||||
|
||||
for k, v in pairs(removingbuttons) do
|
||||
if SysTime() - v > 30 then continue end
|
||||
counter = counter + 1
|
||||
surface.SetTextPos(100, 100 + counter * 16)
|
||||
surface.DrawText(k .. ": " .. math.Round(v, 2))
|
||||
end
|
||||
end
|
||||
|
||||
local function RenderTraces()
|
||||
|
|
|
@ -19,7 +19,7 @@ local function FallCheck()
|
|||
|
||||
local speed = ply:GetVelocity().z
|
||||
|
||||
if not ply.FallStatic and speed <= -800 and ply:GetMoveType() ~= MOVETYPE_NOCLIP and ply:GetDive() == false then
|
||||
if not ply.FallStatic and speed <= -800 and ply:GetMoveType() ~= MOVETYPE_NOCLIP and ply:GetDive() == false and ply:Alive() then
|
||||
ply:EmitSound("FallStatic")
|
||||
ply.FallStatic = true
|
||||
|
||||
|
|
|
@ -1,17 +1,3 @@
|
|||
removingbuttons = {}
|
||||
|
||||
if SERVER then
|
||||
hook.Add("Think", "removingbuttonsprint", function()
|
||||
if engine.TickCount() % 10 == 0 then
|
||||
for i, ply in ipairs(player.GetAll()) do
|
||||
for path, time in pairs(removingbuttons) do
|
||||
ply:SendLua("removingbuttons[" .. "\"" .. path .. "\"" .. "] = " .. " \"" .. time .. " \"")
|
||||
end
|
||||
end
|
||||
end
|
||||
end)
|
||||
end
|
||||
|
||||
local vmatrixmeta = FindMetaTable("VMatrix")
|
||||
local playermeta = FindMetaTable("Player")
|
||||
|
||||
|
|
|
@ -110,7 +110,6 @@ local function ClimbingThink(ply, mv, cmd)
|
|||
ply:SetClimbingDelay(CurTime() + 1.35)
|
||||
end
|
||||
|
||||
removingbuttons["Climb.lua:113"] = SysTime()
|
||||
mv:SetForwardSpeed(0)
|
||||
mv:SetSideSpeed(0)
|
||||
mv:SetUpSpeed(0)
|
||||
|
@ -121,8 +120,6 @@ local function ClimbingThink(ply, mv, cmd)
|
|||
end
|
||||
|
||||
if (ply:GetClimbing() == 2 or ply:GetClimbing() == 6) and ply:GetClimbingTime() >= 1 then
|
||||
removingbuttons["Climb.lua:123"] = SysTime()
|
||||
|
||||
mv:SetButtons(0)
|
||||
mv:SetForwardSpeed(0)
|
||||
mv:SetSideSpeed(0)
|
||||
|
@ -155,7 +152,6 @@ local function ClimbingThink(ply, mv, cmd)
|
|||
|
||||
ply:SetMoveType(MOVETYPE_WALK)
|
||||
|
||||
removingbuttons["Climb.lua:157"] = SysTime()
|
||||
mv:SetButtons(0)
|
||||
|
||||
ply:SetClimbing(0)
|
||||
|
@ -181,7 +177,6 @@ local function ClimbingThink(ply, mv, cmd)
|
|||
if mv:KeyDown(IN_JUMP) and ang > 42 then
|
||||
mv:SetOrigin(ply:GetClimbingStart() - ply:GetClimbingAngle():Forward() * 0.6)
|
||||
ply:SetMoveType(MOVETYPE_WALK)
|
||||
removingbuttons["Climb.lua:183"] = SysTime()
|
||||
mv:SetButtons(0)
|
||||
ply:SetClimbing(0)
|
||||
ply:SetSafetyRollKeyTime(CurTime() + 0.1)
|
||||
|
@ -391,7 +386,6 @@ local function ClimbingThink(ply, mv, cmd)
|
|||
ply:SetClimbingTime(lerp + FrameTime() * lerprate)
|
||||
end
|
||||
|
||||
removingbuttons["Climb.lua:394"] = SysTime()
|
||||
mv:SetForwardSpeed(0)
|
||||
mv:SetSideSpeed(0)
|
||||
mv:SetUpSpeed(0)
|
||||
|
@ -773,7 +767,6 @@ local function ClimbingCheck(ply, mv, cmd)
|
|||
ply:ConCommand("-jump")
|
||||
end
|
||||
|
||||
removingbuttons["Climb.lua:774"] = SysTime()
|
||||
mv:SetButtons(0)
|
||||
mv:SetForwardSpeed(0)
|
||||
mv:SetSideSpeed(0)
|
||||
|
|
|
@ -91,7 +91,6 @@ local function Dive(ply, mv, cmd)
|
|||
ply.DiveSliding = true
|
||||
ply:SetDive(false)
|
||||
elseif ply:OnGround() and mv:KeyDown(IN_BULLRUSH) then
|
||||
removingbuttons["Dive.lua:94"] = SysTime()
|
||||
mv:SetButtons(0)
|
||||
end
|
||||
end
|
||||
|
|
|
@ -78,8 +78,6 @@ local function LadderCheck(ply, mv, cmd, ladder)
|
|||
end
|
||||
|
||||
local function LadderThink(ply, mv, cmd, ladder)
|
||||
removingbuttons["Ladder.lua:81"] = SysTime()
|
||||
|
||||
mv:SetForwardSpeed(0)
|
||||
mv:SetSideSpeed(0)
|
||||
|
||||
|
@ -247,7 +245,6 @@ local function LadderThink(ply, mv, cmd, ladder)
|
|||
return
|
||||
end
|
||||
|
||||
removingbuttons["Ladder.lua:248"] = SysTime()
|
||||
mv:SetVelocity(vector_origin)
|
||||
mv:SetButtons(0)
|
||||
end
|
||||
|
|
|
@ -146,7 +146,6 @@ local function Quickturn(ply, mv, cmd)
|
|||
end
|
||||
|
||||
if ply:GetJumpTurn() then
|
||||
removingbuttons["Quickturn.lua:149"] = SysTime()
|
||||
mv:SetForwardSpeed(0)
|
||||
mv:SetSideSpeed(0)
|
||||
mv:SetUpSpeed(0)
|
||||
|
@ -180,12 +179,10 @@ local function Quickturn(ply, mv, cmd)
|
|||
end
|
||||
|
||||
if CurTime() < ply:GetJumpTurnRecovery() then
|
||||
removingbuttons["Quickturn.lua:183"] = SysTime()
|
||||
mv:SetForwardSpeed(0)
|
||||
mv:SetSideSpeed(0)
|
||||
mv:SetUpSpeed(0)
|
||||
mv:SetButtons(0)
|
||||
removingbuttons["Quickturn.lua:186"] = SysTime()
|
||||
|
||||
cmd:ClearMovement()
|
||||
|
||||
|
|
|
@ -20,18 +20,11 @@ local function SafetyRollThink(ply, mv, cmd)
|
|||
lastGroundSpeed = mv:GetVelocity():Length()
|
||||
end
|
||||
|
||||
local isRolling = CurTime() < ply:GetSafetyRollKeyTime()
|
||||
|
||||
if ply:OnGround() and not isRolling then
|
||||
lastGroundSpeed = mv:GetVelocity():Length()
|
||||
end
|
||||
|
||||
if CurTime() < ply:GetSafetyRollTime() then
|
||||
ply.FootstepLand = false
|
||||
|
||||
local ang = ply:GetSafetyRollAng()
|
||||
|
||||
removingbuttons["SafetyRoll.lua:34"] = SysTime()
|
||||
mv:SetSideSpeed(0)
|
||||
mv:SetForwardSpeed(0)
|
||||
|
||||
|
@ -54,7 +47,6 @@ local function SafetyRollThink(ply, mv, cmd)
|
|||
|
||||
ply:SetMEMoveLimit(450)
|
||||
else
|
||||
removingbuttons["SafetyRoll.lua:57"] = SysTime()
|
||||
mv:SetVelocity(vector_origin)
|
||||
end
|
||||
end
|
||||
|
|
|
@ -366,7 +366,12 @@ hook.Add("SetupMove", "qslide", function(ply, mv, cmd)
|
|||
end
|
||||
end
|
||||
|
||||
if ply:GetSlidingDelay() < CT and ply:Alive() and (ducking and sprinting and speed > runspeed * 0.5 or slippery and ply:GetSafetyRollTime() <= CurTime() + 0.25 or ply:GetDive() and ply:GetSafetyRollKeyTime() <= CurTime()) and onground and not sliding then
|
||||
local isRolling = CurTime() < ply:GetSafetyRollKeyTime()
|
||||
local turnedInAir = ply:GetJumpTurn()
|
||||
//if ply:GetSlidingDelay() < CT and ply:Alive() and (ducking and sprinting and speed > runspeed * 0.5 or slippery and ply:GetSafetyRollTime() <= CurTime() + 0.25 or ply:GetDive() and ply:GetSafetyRollKeyTime() <= CurTime()) and onground and not sliding then
|
||||
if not ply:GetSliding() and not isRolling and not turnedInAir and ply:Alive() and
|
||||
(ply:GetSlidingDelay() < CT) and
|
||||
((ducking and sprinting and speed > runspeed * 0.5) or slippery or ply:GetDive()) then
|
||||
vel = math.min(speed, 541.44) * ply:GetOverdriveMult()
|
||||
|
||||
ParkourEvent(slippery and "slide45" or "slide", ply)
|
||||
|
|
|
@ -80,7 +80,6 @@ local function SwingpipeThink(ply, mv, cmd)
|
|||
return
|
||||
end
|
||||
|
||||
removingbuttons["Swingpipe.lua:83"] = SysTime()
|
||||
mv:SetForwardSpeed(0)
|
||||
mv:SetSideSpeed(0)
|
||||
|
||||
|
|
|
@ -78,7 +78,6 @@ local function SwingbarThink(ply, mv, cmd)
|
|||
return
|
||||
end
|
||||
|
||||
removingbuttons["Swingbar.lua:81"] = SysTime()
|
||||
mv:SetForwardSpeed(0)
|
||||
mv:SetSideSpeed(0)
|
||||
|
||||
|
|
|
@ -577,7 +577,6 @@ hook.Add("SetupMove", "BeatrunVaulting", function(ply, mv, cmd)
|
|||
mv:SetSideSpeed(0)
|
||||
mv:SetUpSpeed(0)
|
||||
mv:SetForwardSpeed(0)
|
||||
removingbuttons["Vaulting.lua:580"] = SysTime()
|
||||
|
||||
cmd:ClearMovement()
|
||||
|
||||
|
@ -772,7 +771,6 @@ hook.Add("SetupMove", "BeatrunVaulting", function(ply, mv, cmd)
|
|||
end
|
||||
end
|
||||
else
|
||||
removingbuttons["Vaulting.lua:774"] = SysTime()
|
||||
mv:SetButtons(0)
|
||||
end
|
||||
end
|
||||
|
|
|
@ -96,7 +96,6 @@ local function WallrunningThink(ply, mv, cmd)
|
|||
mv:SetVelocity(vel)
|
||||
mv:SetSideSpeed(0)
|
||||
mv:SetForwardSpeed(0)
|
||||
removingbuttons["Wallrun.lua:99"] = SysTime()
|
||||
|
||||
if ply:GetWallrunTime() < CurTime() or mv:GetVelocity():Length() < 10 then
|
||||
ply:SetWallrun(0)
|
||||
|
@ -145,7 +144,6 @@ local function WallrunningThink(ply, mv, cmd)
|
|||
vecvel:Add(ply:GetWallrunDir():Angle():Forward() * -50)
|
||||
vecvel:Mul(ply:GetOverdriveMult())
|
||||
|
||||
removingbuttons["Walltrun.lua:148"] = SysTime()
|
||||
mv:SetVelocity(vecvel)
|
||||
mv:SetForwardSpeed(0)
|
||||
mv:SetSideSpeed(0)
|
||||
|
@ -187,7 +185,6 @@ local function WallrunningThink(ply, mv, cmd)
|
|||
if wr >= 2 and wrtimeremains then
|
||||
local dir = wr == 2 and 1 or -1
|
||||
|
||||
removingbuttons["Walltrun.lua:190"] = SysTime()
|
||||
mv:SetForwardSpeed(0)
|
||||
mv:SetSideSpeed(0)
|
||||
|
||||
|
|
|
@ -186,7 +186,6 @@ function PuristWallrunningThink(ply, mv, cmd, wr, wrtimeremains)
|
|||
local vel = ang:Forward() * 30
|
||||
vel.z = 25
|
||||
|
||||
removingbuttons["WallrunME.lua:189"] = SysTime()
|
||||
mv:SetVelocity(vel)
|
||||
mv:SetSideSpeed(0)
|
||||
mv:SetForwardSpeed(0)
|
||||
|
@ -238,7 +237,6 @@ function PuristWallrunningThink(ply, mv, cmd, wr, wrtimeremains)
|
|||
vecvel:Add(ply:GetWallrunDir():Angle():Forward() * -50)
|
||||
vecvel:Mul(ply:GetOverdriveMult())
|
||||
|
||||
removingbuttons["WallrunME.lua:241"] = SysTime()
|
||||
mv:SetVelocity(vecvel)
|
||||
mv:SetForwardSpeed(0)
|
||||
mv:SetSideSpeed(0)
|
||||
|
@ -280,7 +278,6 @@ function PuristWallrunningThink(ply, mv, cmd, wr, wrtimeremains)
|
|||
if wr >= 2 and wrtimeremains then
|
||||
local dir = wr == 2 and 1 or -1
|
||||
|
||||
removingbuttons["WallrunME.lua:283"] = SysTime()
|
||||
mv:SetForwardSpeed(0)
|
||||
mv:SetSideSpeed(0)
|
||||
|
||||
|
|
|
@ -211,7 +211,6 @@ local function ZiplineThink(ply, mv, cmd, zipline)
|
|||
ply:SetZiplineSpeed(math.Approach(speed, 750, FrameTime() * 250))
|
||||
|
||||
mv:SetVelocity(dir * speed)
|
||||
removingbuttons["Zipline.lua:214"] = SysTime()
|
||||
mv:SetButtons(0)
|
||||
mv:SetForwardSpeed(0)
|
||||
mv:SetSideSpeed(0)
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
VERSION_GLOBAL = "1.0.26"
|
||||
VERSION_GLOBAL = "1.0.27"
|
||||
VERSION_LATEST = ""
|
||||
VERSION_CHECKED = false
|
||||
|
||||
|
|
|
@ -1 +1 @@
|
|||
1.0.26
|
||||
1.0.27
|
Loading…
Reference in a new issue