diff --git a/beatrun/gamemodes/beatrun/content/sound/datae/fol_slide_dirt_01.wav b/beatrun/gamemodes/beatrun/content/sound/fol/fol_slide_dirt_01.wav similarity index 100% rename from beatrun/gamemodes/beatrun/content/sound/datae/fol_slide_dirt_01.wav rename to beatrun/gamemodes/beatrun/content/sound/fol/fol_slide_dirt_01.wav diff --git a/beatrun/gamemodes/beatrun/content/sound/datae/fol_slide_dirt_02.wav b/beatrun/gamemodes/beatrun/content/sound/fol/fol_slide_dirt_02.wav similarity index 100% rename from beatrun/gamemodes/beatrun/content/sound/datae/fol_slide_dirt_02.wav rename to beatrun/gamemodes/beatrun/content/sound/fol/fol_slide_dirt_02.wav diff --git a/beatrun/gamemodes/beatrun/content/sound/datae/fol_slide_dirt_03.wav b/beatrun/gamemodes/beatrun/content/sound/fol/fol_slide_dirt_03.wav similarity index 100% rename from beatrun/gamemodes/beatrun/content/sound/datae/fol_slide_dirt_03.wav rename to beatrun/gamemodes/beatrun/content/sound/fol/fol_slide_dirt_03.wav diff --git a/beatrun/gamemodes/beatrun/content/sound/datae/fol_slide_dirt_04.wav b/beatrun/gamemodes/beatrun/content/sound/fol/fol_slide_dirt_04.wav similarity index 100% rename from beatrun/gamemodes/beatrun/content/sound/datae/fol_slide_dirt_04.wav rename to beatrun/gamemodes/beatrun/content/sound/fol/fol_slide_dirt_04.wav diff --git a/beatrun/gamemodes/beatrun/content/sound/datae/fol_slide_generic_01.wav b/beatrun/gamemodes/beatrun/content/sound/fol/fol_slide_generic_01.wav similarity index 100% rename from beatrun/gamemodes/beatrun/content/sound/datae/fol_slide_generic_01.wav rename to beatrun/gamemodes/beatrun/content/sound/fol/fol_slide_generic_01.wav diff --git a/beatrun/gamemodes/beatrun/content/sound/datae/fol_slide_generic_02.wav b/beatrun/gamemodes/beatrun/content/sound/fol/fol_slide_generic_02.wav similarity index 100% rename from beatrun/gamemodes/beatrun/content/sound/datae/fol_slide_generic_02.wav rename to beatrun/gamemodes/beatrun/content/sound/fol/fol_slide_generic_02.wav diff --git a/beatrun/gamemodes/beatrun/content/sound/datae/fol_slide_generic_03.wav b/beatrun/gamemodes/beatrun/content/sound/fol/fol_slide_generic_03.wav similarity index 100% rename from beatrun/gamemodes/beatrun/content/sound/datae/fol_slide_generic_03.wav rename to beatrun/gamemodes/beatrun/content/sound/fol/fol_slide_generic_03.wav diff --git a/beatrun/gamemodes/beatrun/content/sound/datae/fol_slide_glass_01.wav b/beatrun/gamemodes/beatrun/content/sound/fol/fol_slide_glass_01.wav similarity index 100% rename from beatrun/gamemodes/beatrun/content/sound/datae/fol_slide_glass_01.wav rename to beatrun/gamemodes/beatrun/content/sound/fol/fol_slide_glass_01.wav diff --git a/beatrun/gamemodes/beatrun/content/sound/datae/fol_slide_glass_02.wav b/beatrun/gamemodes/beatrun/content/sound/fol/fol_slide_glass_02.wav similarity index 100% rename from beatrun/gamemodes/beatrun/content/sound/datae/fol_slide_glass_02.wav rename to beatrun/gamemodes/beatrun/content/sound/fol/fol_slide_glass_02.wav diff --git a/beatrun/gamemodes/beatrun/content/sound/datae/fol_slide_glass_03.wav b/beatrun/gamemodes/beatrun/content/sound/fol/fol_slide_glass_03.wav similarity index 100% rename from beatrun/gamemodes/beatrun/content/sound/datae/fol_slide_glass_03.wav rename to beatrun/gamemodes/beatrun/content/sound/fol/fol_slide_glass_03.wav diff --git a/beatrun/gamemodes/beatrun/content/sound/datae/fol_slide_glass_04.wav b/beatrun/gamemodes/beatrun/content/sound/fol/fol_slide_glass_04.wav similarity index 100% rename from beatrun/gamemodes/beatrun/content/sound/datae/fol_slide_glass_04.wav rename to beatrun/gamemodes/beatrun/content/sound/fol/fol_slide_glass_04.wav diff --git a/beatrun/gamemodes/beatrun/content/sound/datae/fol_slide_grate_01.wav b/beatrun/gamemodes/beatrun/content/sound/fol/fol_slide_grate_01.wav similarity index 100% rename from beatrun/gamemodes/beatrun/content/sound/datae/fol_slide_grate_01.wav rename to beatrun/gamemodes/beatrun/content/sound/fol/fol_slide_grate_01.wav diff --git a/beatrun/gamemodes/beatrun/content/sound/datae/fol_slide_metal_01.wav b/beatrun/gamemodes/beatrun/content/sound/fol/fol_slide_metal_01.wav similarity index 100% rename from beatrun/gamemodes/beatrun/content/sound/datae/fol_slide_metal_01.wav rename to beatrun/gamemodes/beatrun/content/sound/fol/fol_slide_metal_01.wav diff --git a/beatrun/gamemodes/beatrun/content/sound/datae/fol_slide_metal_02.wav b/beatrun/gamemodes/beatrun/content/sound/fol/fol_slide_metal_02.wav similarity index 100% rename from beatrun/gamemodes/beatrun/content/sound/datae/fol_slide_metal_02.wav rename to beatrun/gamemodes/beatrun/content/sound/fol/fol_slide_metal_02.wav diff --git a/beatrun/gamemodes/beatrun/content/sound/datae/fol_slide_metal_03.wav b/beatrun/gamemodes/beatrun/content/sound/fol/fol_slide_metal_03.wav similarity index 100% rename from beatrun/gamemodes/beatrun/content/sound/datae/fol_slide_metal_03.wav rename to beatrun/gamemodes/beatrun/content/sound/fol/fol_slide_metal_03.wav diff --git a/beatrun/gamemodes/beatrun/content/sound/datae/fol_slide_sand_01.wav b/beatrun/gamemodes/beatrun/content/sound/fol/fol_slide_sand_01.wav similarity index 100% rename from beatrun/gamemodes/beatrun/content/sound/datae/fol_slide_sand_01.wav rename to beatrun/gamemodes/beatrun/content/sound/fol/fol_slide_sand_01.wav diff --git a/beatrun/gamemodes/beatrun/content/sound/datae/fol_slide_sand_02.wav b/beatrun/gamemodes/beatrun/content/sound/fol/fol_slide_sand_02.wav similarity index 100% rename from beatrun/gamemodes/beatrun/content/sound/datae/fol_slide_sand_02.wav rename to beatrun/gamemodes/beatrun/content/sound/fol/fol_slide_sand_02.wav diff --git a/beatrun/gamemodes/beatrun/content/sound/datae/fol_slide_sand_03.wav b/beatrun/gamemodes/beatrun/content/sound/fol/fol_slide_sand_03.wav similarity index 100% rename from beatrun/gamemodes/beatrun/content/sound/datae/fol_slide_sand_03.wav rename to beatrun/gamemodes/beatrun/content/sound/fol/fol_slide_sand_03.wav diff --git a/beatrun/gamemodes/beatrun/content/sound/datae/fol_slide_sand_04.wav b/beatrun/gamemodes/beatrun/content/sound/fol/fol_slide_sand_04.wav similarity index 100% rename from beatrun/gamemodes/beatrun/content/sound/datae/fol_slide_sand_04.wav rename to beatrun/gamemodes/beatrun/content/sound/fol/fol_slide_sand_04.wav diff --git a/beatrun/gamemodes/beatrun/content/sound/datae/fol_sprint_rustle_01.wav b/beatrun/gamemodes/beatrun/content/sound/fol/fol_sprint_rustle_01.wav similarity index 100% rename from beatrun/gamemodes/beatrun/content/sound/datae/fol_sprint_rustle_01.wav rename to beatrun/gamemodes/beatrun/content/sound/fol/fol_sprint_rustle_01.wav diff --git a/beatrun/gamemodes/beatrun/content/sound/datae/fol_sprint_rustle_02.wav b/beatrun/gamemodes/beatrun/content/sound/fol/fol_sprint_rustle_02.wav similarity index 100% rename from beatrun/gamemodes/beatrun/content/sound/datae/fol_sprint_rustle_02.wav rename to beatrun/gamemodes/beatrun/content/sound/fol/fol_sprint_rustle_02.wav diff --git a/beatrun/gamemodes/beatrun/content/sound/datae/fol_sprint_rustle_03.wav b/beatrun/gamemodes/beatrun/content/sound/fol/fol_sprint_rustle_03.wav similarity index 100% rename from beatrun/gamemodes/beatrun/content/sound/datae/fol_sprint_rustle_03.wav rename to beatrun/gamemodes/beatrun/content/sound/fol/fol_sprint_rustle_03.wav diff --git a/beatrun/gamemodes/beatrun/content/sound/datae/fol_sprint_rustle_04.wav b/beatrun/gamemodes/beatrun/content/sound/fol/fol_sprint_rustle_04.wav similarity index 100% rename from beatrun/gamemodes/beatrun/content/sound/datae/fol_sprint_rustle_04.wav rename to beatrun/gamemodes/beatrun/content/sound/fol/fol_sprint_rustle_04.wav diff --git a/beatrun/gamemodes/beatrun/content/sound/datae/fol_sprint_rustle_05.wav b/beatrun/gamemodes/beatrun/content/sound/fol/fol_sprint_rustle_05.wav similarity index 100% rename from beatrun/gamemodes/beatrun/content/sound/datae/fol_sprint_rustle_05.wav rename to beatrun/gamemodes/beatrun/content/sound/fol/fol_sprint_rustle_05.wav diff --git a/beatrun/gamemodes/beatrun/gamemode/cl/DiscordPresence.lua b/beatrun/gamemodes/beatrun/gamemode/cl/DiscordPresence.lua index 9259173..b6e2d84 100644 --- a/beatrun/gamemodes/beatrun/gamemode/cl/DiscordPresence.lua +++ b/beatrun/gamemodes/beatrun/gamemode/cl/DiscordPresence.lua @@ -1,4 +1,4 @@ -if not util.IsBinaryModuleInstalled("gdiscord", "GAME") then return end +if not util.IsBinaryModuleInstalled("gdiscord") then return end require("gdiscord") @@ -8,6 +8,9 @@ local refresh_time = 60 local discord_start = discord_start or -1 function DiscordUpdate() + local ply = LocalPlayer() + if not ply.GetLevel then return end + local rpc_data = {} if game.SinglePlayer() then @@ -34,14 +37,10 @@ function DiscordUpdate() rpc_data["partyMax"] = 0 end - local level = LocalPlayer():GetLevel() + local level = ply:GetLevel() local customname = hook.Run("BeatrunHUDCourse") local course = customname and customname or Course_Name ~= "" and Course_Name or "Freeplay" - if course == nil then - course = "Freeplay" - end - rpc_data["details"] = "Level: " .. level .. " | Map: " .. game.GetMap() rpc_data["startTimestamp"] = discord_start diff --git a/beatrun/gamemodes/beatrun/gamemode/cl/SteamPresence.lua b/beatrun/gamemodes/beatrun/gamemode/cl/SteamPresence.lua index a0453aa..f1c05fa 100644 --- a/beatrun/gamemodes/beatrun/gamemode/cl/SteamPresence.lua +++ b/beatrun/gamemodes/beatrun/gamemode/cl/SteamPresence.lua @@ -1,4 +1,4 @@ -if not util.IsBinaryModuleInstalled("steamrichpresencer", "GAME") then return end +if not util.IsBinaryModuleInstalled("steamrichpresencer") then return end require("steamrichpresencer") @@ -10,14 +10,9 @@ local function UpdateRichPresence() if not ply.GetLevel then return end local map = game.GetMap() - local level = LocalPlayer():GetLevel() - local course = nil + local level = ply:GetLevel() local customname = hook.Run("BeatrunHUDCourse") - course = customname and customname or Course_Name ~= "" and Course_Name or "Freeplay" - - if course == nil then - course = "Freeplay" - end + local course = customname and customname or Course_Name ~= "" and Course_Name or "Freeplay" local updatedtext = "Beatrun Lv. " .. level .. " (" .. map .. ") | " .. course diff --git a/beatrun/gamemodes/beatrun/gamemode/sh/0_Helpers.lua b/beatrun/gamemodes/beatrun/gamemode/sh/0_Helpers.lua index 3d8b40e..d33bf4f 100644 --- a/beatrun/gamemodes/beatrun/gamemode/sh/0_Helpers.lua +++ b/beatrun/gamemodes/beatrun/gamemode/sh/0_Helpers.lua @@ -3,19 +3,6 @@ local playermeta = FindMetaTable("Player") CLoadout = {} -function CLIENT_IFTP() - return CLIENT and IsFirstTimePredicted() -end - ---[[ -local matrixdatatmp = { - {0, 0, 0, 0}, - {0, 0, 0, 0}, - {0, 0, 0, 0}, - {0, 0, 0, 1} -} -]] - local mtmp = { {0, 0, 0, 0}, {0, 0, 0, 0}, diff --git a/beatrun/gamemodes/beatrun/gamemode/sh/0_Sounds_!Precache.lua b/beatrun/gamemodes/beatrun/gamemode/sh/0_Sounds_!Precache.lua index bcae2eb..eb57365 100644 --- a/beatrun/gamemodes/beatrun/gamemode/sh/0_Sounds_!Precache.lua +++ b/beatrun/gamemodes/beatrun/gamemode/sh/0_Sounds_!Precache.lua @@ -2,6 +2,7 @@ soundAdd_old = sound.Add local function soundAdd_detour(tbl) if not tbl.name then return end + soundAdd_old(tbl) timer.Simple(2, function() diff --git a/beatrun/gamemodes/beatrun/gamemode/sh/Balance.lua b/beatrun/gamemodes/beatrun/gamemode/sh/Balance.lua index 550c601..4b02193 100644 --- a/beatrun/gamemodes/beatrun/gamemode/sh/Balance.lua +++ b/beatrun/gamemodes/beatrun/gamemode/sh/Balance.lua @@ -75,7 +75,7 @@ hook.Add("SetupMove", "Balance", function(ply, mv, cmd) ParkourEvent("walkbalancestill", ply) end - if CLIENT_IFTP() and mv:KeyPressed(IN_ATTACK2) then + if CLIENT and IsFirstTimePredicted() and mv:KeyPressed(IN_ATTACK2) then dircache.y = dircache.y - 180 end diff --git a/beatrun/gamemodes/beatrun/gamemode/sh/Climb.lua b/beatrun/gamemodes/beatrun/gamemode/sh/Climb.lua index 7e5fbdf..e0a66f2 100644 --- a/beatrun/gamemodes/beatrun/gamemode/sh/Climb.lua +++ b/beatrun/gamemodes/beatrun/gamemode/sh/Climb.lua @@ -159,7 +159,7 @@ local function ClimbingThink(ply, mv, cmd) ParkourEvent("hangend", ply) - if CLIENT_IFTP() then + if CLIENT and IsFirstTimePredicted() then lockang2 = false lockang = false BodyLimitX = 90 @@ -182,7 +182,7 @@ local function ClimbingThink(ply, mv, cmd) ply:SetSafetyRollKeyTime(CurTime() + 0.1) ParkourEvent("hangjump", ply) - if CLIENT_IFTP() then + if CLIENT and IsFirstTimePredicted() then lockang2 = false lockang = false BodyLimitX = 90 @@ -716,7 +716,7 @@ local function ClimbingCheck(ply, mv, cmd) ply:EmitSound("Handsteps.ConcreteHard") ply:EmitSound("Cloth.RollLand") - if CLIENT_IFTP() then + if CLIENT and IsFirstTimePredicted() then ply.OrigEyeAng = wallang lockang2 = true diff --git a/beatrun/gamemodes/beatrun/gamemode/sh/Dive.lua b/beatrun/gamemodes/beatrun/gamemode/sh/Dive.lua index 863c6a7..7819eae 100644 --- a/beatrun/gamemodes/beatrun/gamemode/sh/Dive.lua +++ b/beatrun/gamemodes/beatrun/gamemode/sh/Dive.lua @@ -37,7 +37,7 @@ local function Dive(ply, mv, cmd) effectdata:SetOrigin(vPoint) util.Effect("WaterSurfaceExplosion", effectdata) - elseif CLIENT_IFTP() then + elseif CLIENT and IsFirstTimePredicted() then local vPoint = mv:GetOrigin() local effectdata = EffectData() diff --git a/beatrun/gamemodes/beatrun/gamemode/sh/Grapple.lua b/beatrun/gamemodes/beatrun/gamemode/sh/Grapple.lua index d941442..81d8305 100644 --- a/beatrun/gamemodes/beatrun/gamemode/sh/Grapple.lua +++ b/beatrun/gamemodes/beatrun/gamemode/sh/Grapple.lua @@ -91,7 +91,7 @@ hook.Add("SetupMove", "Grapple", function(ply, mv, cmd) ply:SetNW2Entity("grappleEntity", trout.Entity) ply:SetNW2Bool("grappledNonCourse", true) - if CLIENT_IFTP() or game.SinglePlayer() then + if CLIENT and IsFirstTimePredicted() or game.SinglePlayer() then ply:EmitSound("MirrorsEdge/Gadgets/ME_Magrope_Fire.wav", 40, 100 + math.random(-25, 10)) end @@ -131,7 +131,7 @@ hook.Add("SetupMove", "Grapple", function(ply, mv, cmd) ply:SetGrappling(false) - if CLIENT_IFTP() or game.SinglePlayer() then + if CLIENT and IsFirstTimePredicted() or game.SinglePlayer() then ply:EmitSound("MirrorsEdge/zipline_detach.wav", 40, 100 + math.random(-25, 10)) end diff --git a/beatrun/gamemodes/beatrun/gamemode/sh/Ladder.lua b/beatrun/gamemodes/beatrun/gamemode/sh/Ladder.lua index ce8d228..9b4eff4 100644 --- a/beatrun/gamemodes/beatrun/gamemode/sh/Ladder.lua +++ b/beatrun/gamemodes/beatrun/gamemode/sh/Ladder.lua @@ -36,7 +36,7 @@ local function LadderCheck(ply, mv, cmd, ladder) ply:SendLua("BodyAnimSetEase(LocalPlayer():GetNW2Vector('SPBAEase'))") end - if CLIENT_IFTP() then + if CLIENT and IsFirstTimePredicted() then local ang = ply:EyeAngles() ang.y = ladder:GetAngles().y - 180 ang.x = 0 @@ -141,7 +141,7 @@ local function LadderThink(ply, mv, cmd, ladder) elseif ply.LadderDown and ply:GetLadderDelay() < CurTime() then ply.LadderDown = false - if CLIENT_IFTP() then + if CLIENT and IsFirstTimePredicted() then ply:CLViewPunch(Angle(5, 0, 0)) BodyAnim:SetSequence("ladderclimbuprighthandstill") elseif game.SinglePlayer() then @@ -233,7 +233,7 @@ local function LadderThink(ply, mv, cmd, ladder) mv:SetOrigin(newpos) mv:SetVelocity(vector_origin) - if CLIENT_IFTP() then + if CLIENT and IsFirstTimePredicted() then BodyAnim:SetSequence("jumpfast") elseif game.SinglePlayer() then ply:SendLua("BodyAnim:SetSequence('jumpfast')") diff --git a/beatrun/gamemodes/beatrun/gamemode/sh/Melee.lua b/beatrun/gamemodes/beatrun/gamemode/sh/Melee.lua index 6ac01af..b80f65f 100644 --- a/beatrun/gamemodes/beatrun/gamemode/sh/Melee.lua +++ b/beatrun/gamemodes/beatrun/gamemode/sh/Melee.lua @@ -19,7 +19,7 @@ local meleedata = { }, { "meleeslide", 0.175, 0.6, function(ply, mv, cmd) - if CLIENT_IFTP() then + if CLIENT and IsFirstTimePredicted() then ply:CLViewPunch(Angle(0.05, 0, -1)) elseif game.SinglePlayer() then ply:ViewPunch(Angle(0.1, 0, -1.5)) @@ -29,7 +29,7 @@ local meleedata = { }, { "meleeairstill", 0.1, 1, function(ply, mv, cmd) - if CLIENT_IFTP() then + if CLIENT and IsFirstTimePredicted() then ply:CLViewPunch(Angle(0.5, 0, -0.1)) elseif game.SinglePlayer() then ply:ViewPunch(Angle(1, 0, -0.25)) @@ -39,7 +39,7 @@ local meleedata = { }, { "meleeair", 0.15, 1, function(ply, mv, cmd) - if CLIENT_IFTP() then + if CLIENT and IsFirstTimePredicted() then ply:CLViewPunch(Angle(0.05, 0, -1)) elseif game.SinglePlayer() then ply:ViewPunch(Angle(0.1, 0, -1.5)) @@ -51,7 +51,7 @@ local meleedata = { meleedata[5] = { "meleewrleft", 0.2, 0.75, function(ply, mv, cmd) - if CLIENT_IFTP() then + if CLIENT and IsFirstTimePredicted() then ply:CLViewPunch(Angle(0.075, 0, 1)) elseif game.SinglePlayer() then ply:ViewPunch(Angle(0.1, 0, 1.5)) @@ -64,7 +64,7 @@ meleedata[5] = { mv:SetVelocity(vel) - if CLIENT_IFTP() or game.SinglePlayer() then + if CLIENT and IsFirstTimePredicted() or game.SinglePlayer() then local ang = ply:EyeAngles() ang.y = ang.y + (CurTime() - ply:GetMeleeDelay()) / 0.15 * 0.25 @@ -76,7 +76,7 @@ meleedata[5] = { meleedata[6] = { "meleewrright", 0.2, 0.75, function(ply, mv, cmd) - if CLIENT_IFTP() then + if CLIENT and IsFirstTimePredicted() then ply:CLViewPunch(Angle(0.075, 0, -1)) elseif game.SinglePlayer() then ply:ViewPunch(Angle(0.1, 0, -1.5)) @@ -89,7 +89,7 @@ meleedata[6] = { mv:SetVelocity(vel) - if CLIENT_IFTP() or game.SinglePlayer() then + if CLIENT and IsFirstTimePredicted() or game.SinglePlayer() then local ang = ply:EyeAngles() ang.y = ang.y - (CurTime() - ply:GetMeleeDelay()) / 0.15 * 0.25 diff --git a/beatrun/gamemodes/beatrun/gamemode/sh/Misc.lua b/beatrun/gamemodes/beatrun/gamemode/sh/Misc.lua index d6d78f4..44fe7e7 100644 --- a/beatrun/gamemodes/beatrun/gamemode/sh/Misc.lua +++ b/beatrun/gamemodes/beatrun/gamemode/sh/Misc.lua @@ -29,7 +29,7 @@ hook.Add("PlayerNoClip", "BlockNoClip", function(ply, enabled) if enabled and Course_Name ~= "" and ply:GetNW2Int("CPNum", 1) ~= -1 then ply:SetNW2Int("CPNum", -1) - if CLIENT_IFTP() then + if CLIENT and IsFirstTimePredicted() then notification.AddLegacy("Noclip Detected! Respawn to restart the course", NOTIFY_ERROR, 4) elseif SERVER and game.SinglePlayer() then ply:SendLua("notification.AddLegacy(\"Noclip Detected! Respawn to restart the course\", NOTIFY_ERROR, 4)") diff --git a/beatrun/gamemodes/beatrun/gamemode/sh/Monkey.lua b/beatrun/gamemodes/beatrun/gamemode/sh/Monkey.lua index b581516..5472ea7 100644 --- a/beatrun/gamemodes/beatrun/gamemode/sh/Monkey.lua +++ b/beatrun/gamemodes/beatrun/gamemode/sh/Monkey.lua @@ -158,7 +158,7 @@ local function SwingbarThink(ply, mv, cmd) ply:SetSBDelay(CurTime() + 1) - if CLIENT_IFTP() or game.SinglePlayer() then + if CLIENT and IsFirstTimePredicted() or game.SinglePlayer() then ply:EmitSound("Cloth.VaultSwish") end diff --git a/beatrun/gamemodes/beatrun/gamemode/sh/Quickturn.lua b/beatrun/gamemodes/beatrun/gamemode/sh/Quickturn.lua index 51c6b07..84857fb 100644 --- a/beatrun/gamemodes/beatrun/gamemode/sh/Quickturn.lua +++ b/beatrun/gamemodes/beatrun/gamemode/sh/Quickturn.lua @@ -96,7 +96,7 @@ local function Quickturn(ply, mv, cmd) if not lookahead and not lookbehind and ply:WaterLevel() < 3 and not IsValid(ply:GetSwingbar()) and not IsValid(ply:GetZipline()) then return elseif (lookahead or lookbehind) and ply:WaterLevel() < 3 and not IsValid(ply:GetSwingbar()) and not IsValid(ply:GetZipline()) then - if CLIENT_IFTP() then + if CLIENT and IsFirstTimePredicted() then DoJumpTurn(lookbehind) elseif SERVER and game.SinglePlayer() then ply:SendLua("DoJumpTurn(" .. tostring(lookbehind) .. ")") @@ -212,7 +212,7 @@ local function Quickturn(ply, mv, cmd) standpunch.z = 0 end - if CLIENT_IFTP() then + if CLIENT and IsFirstTimePredicted() then ply:CLViewPunch(standpunch) elseif game.SinglePlayer() then ply:ViewPunch(standpunch) @@ -236,7 +236,7 @@ local function Quickturn(ply, mv, cmd) target.y = lerp - if CLIENT_IFTP() or game.SinglePlayer() then + if CLIENT and IsFirstTimePredicted() or game.SinglePlayer() then ply:SetEyeAngles(target) end diff --git a/beatrun/gamemodes/beatrun/gamemode/sh/SafetyRoll.lua b/beatrun/gamemodes/beatrun/gamemode/sh/SafetyRoll.lua index de83799..5ccd087 100644 --- a/beatrun/gamemodes/beatrun/gamemode/sh/SafetyRoll.lua +++ b/beatrun/gamemodes/beatrun/gamemode/sh/SafetyRoll.lua @@ -91,12 +91,12 @@ hook.Add("SetupMove", "EvadeRoll", function(ply, mv, cmd) if SERVER and not land then ply:EmitSound("Cloth.Roll") ply:EmitSound("Cloth.RollLand") - elseif CLIENT_IFTP() or game.SinglePlayer() then + elseif CLIENT and IsFirstTimePredicted() or game.SinglePlayer() then ply:EmitSound("Handsteps.ConcreteHard") ply:EmitSound("Land.Concrete") end - if CLIENT_IFTP() then + if CLIENT and IsFirstTimePredicted() then CacheBodyAnim() RemoveBodyAnim() StartBodyAnim(roll) @@ -155,12 +155,12 @@ hook.Add("OnPlayerHitGround", "SafetyRoll", function(ply, water, floater, speed) if SERVER and not land then ply:EmitSound("Cloth.Roll") ply:EmitSound("Cloth.RollLand") - elseif CLIENT_IFTP() or game.SinglePlayer() then + elseif CLIENT and IsFirstTimePredicted() or game.SinglePlayer() then ply:EmitSound("Handsteps.ConcreteHard") ply:EmitSound("Land.Concrete") end - if CLIENT_IFTP() then + if CLIENT and IsFirstTimePredicted() then CacheBodyAnim() RemoveBodyAnim() StartBodyAnim(roll) diff --git a/beatrun/gamemodes/beatrun/gamemode/sh/Sliding.lua b/beatrun/gamemodes/beatrun/gamemode/sh/Sliding.lua index 86facac..d7915e0 100644 --- a/beatrun/gamemodes/beatrun/gamemode/sh/Sliding.lua +++ b/beatrun/gamemodes/beatrun/gamemode/sh/Sliding.lua @@ -2,13 +2,13 @@ local qslide_duration = 3 local qslide_speedmult = 1 local slide_sounds = { - [MAT_DIRT] = {"datae/fol_slide_dirt_01.wav", "datae/fol_slide_dirt_02.wav", "datae/fol_slide_dirt_03.wav", "datae/fol_slide_dirt_04.wav"}, - [MAT_SAND] = {"datae/fol_slide_sand_01.wav", "datae/fol_slide_sand_02.wav", "datae/fol_slide_sand_03.wav", "datae/fol_slide_sand_04.wav"}, - [MAT_METAL] = {"datae/fol_slide_metal_01.wav", "datae/fol_slide_metal_02.wav", "datae/fol_slide_metal_03.wav"}, - [MAT_GLASS] = {"datae/fol_slide_glass_01.wav", "datae/fol_slide_glass_02.wav", "datae/fol_slide_glass_03.wav", "datae/fol_slide_glass_04.wav"}, - [MAT_GRATE] = {"datae/fol_slide_grate_01.wav"}, + [MAT_DIRT] = {"fol/fol_slide_dirt_01.wav", "fol/fol_slide_dirt_02.wav", "fol/fol_slide_dirt_03.wav", "fol/fol_slide_dirt_04.wav"}, + [MAT_SAND] = {"fol/fol_slide_sand_01.wav", "fol/fol_slide_sand_02.wav", "fol/fol_slide_sand_03.wav", "fol/fol_slide_sand_04.wav"}, + [MAT_METAL] = {"fol/fol_slide_metal_01.wav", "fol/fol_slide_metal_02.wav", "fol/fol_slide_metal_03.wav"}, + [MAT_GLASS] = {"fol/fol_slide_glass_01.wav", "fol/fol_slide_glass_02.wav", "fol/fol_slide_glass_03.wav", "fol/fol_slide_glass_04.wav"}, + [MAT_GRATE] = {"fol/fol_slide_grate_01.wav"}, [MAT_SLOSH] = {"ambient/water/water_splash1.wav", "ambient/water/water_splash2.wav", "ambient/water/water_splash3.wav"}, - [MAT_WOOD] = {"datae/fol_slide_generic_01.wav", "datae/fol_slide_generic_02.wav", "datae/fol_slide_generic_03.wav"} + [MAT_WOOD] = {"fol/fol_slide_generic_01.wav", "fol/fol_slide_generic_02.wav", "fol/fol_slide_generic_03.wav"} } local slideloop_sounds = { @@ -430,7 +430,7 @@ hook.Add("SetupMove", "qslide", function(ply, mv, cmd) net.Send(ply) end - if CLIENT_IFTP() then + if CLIENT and IsFirstTimePredicted() then SlidingAnimStart() hook.Add("Think", "SlidingAnimThink", SlidingAnimThink) @@ -480,7 +480,7 @@ hook.Add("SetupMove", "qslide", function(ply, mv, cmd) net.Send(ply) ply.DiveSliding = false - elseif CLIENT_IFTP() then + elseif CLIENT and IsFirstTimePredicted() then SlidingAnimEnd(false, ply.DiveSliding) ply.DiveSliding = false @@ -623,7 +623,7 @@ hook.Add("SetupMove", "qslide", function(ply, mv, cmd) net.WriteBool(slippery) net.WriteBool(ply.DiveSliding) net.Send(ply) - elseif CLIENT_IFTP() then + elseif CLIENT and IsFirstTimePredicted() then SlidingAnimEnd(slippery, ply.DiveSliding) end diff --git a/beatrun/gamemodes/beatrun/gamemode/sh/SwingPipe.lua b/beatrun/gamemodes/beatrun/gamemode/sh/SwingPipe.lua index 2b99db7..0faf361 100644 --- a/beatrun/gamemodes/beatrun/gamemode/sh/SwingPipe.lua +++ b/beatrun/gamemodes/beatrun/gamemode/sh/SwingPipe.lua @@ -162,7 +162,7 @@ local function SwingpipeThink(ply, mv, cmd) if CLIENT or game.SinglePlayer() then ply:SetEyeAngles(LerpAngle(startlerp, ply:EyeAngles(), circlepos:Angle())) - if CLIENT_IFTP() then + if CLIENT and IsFirstTimePredicted() then viewtiltlerp.z = startlerp * -10 * dir ply:CLViewPunch(Angle(0, 0.1 * dir)) diff --git a/beatrun/gamemodes/beatrun/gamemode/sh/Vaulting.lua b/beatrun/gamemodes/beatrun/gamemode/sh/Vaulting.lua index b53fa6b..6db9195 100644 --- a/beatrun/gamemodes/beatrun/gamemode/sh/Vaulting.lua +++ b/beatrun/gamemodes/beatrun/gamemode/sh/Vaulting.lua @@ -231,7 +231,7 @@ local function Vault2(ply, mv, ang, t, h) local hulltr2 = util.TraceHull(h) if not hulltr.Hit and not hulltr2.Hit then - if t.MatType == MAT_GRATE and (CLIENT_IFTP() or game.SinglePlayer()) then + if t.MatType == MAT_GRATE and (CLIENT and IsFirstTimePredicted() or game.SinglePlayer()) then ply:EmitSound("FenceClimb") end @@ -331,7 +331,7 @@ local function Vault3(ply, mv, ang, t, h) local hulltr2 = util.TraceHull(h) if not hulltr.Hit and not hulltr2.Hit then - if t.MatType == MAT_GRATE and (CLIENT_IFTP() or game.SinglePlayer()) then + if t.MatType == MAT_GRATE and (CLIENT and IsFirstTimePredicted() or game.SinglePlayer()) then ply:EmitSound("FenceClimb") end @@ -596,7 +596,7 @@ hook.Add("SetupMove", "BeatrunVaulting", function(ply, mv, cmd) if not ply.VaultStepUp and mlerp > 0.01 and mlerp < 0.65 then mlerprate = mlerprate * mlerp / 0.5 - if CLIENT_IFTP() then + if CLIENT and IsFirstTimePredicted() then ply:CLViewPunch(Angle(0.1 / (mlerp / 0.25), 0, 0.05)) elseif game.SinglePlayer() then ply:ViewPunch(Angle(0.33 / (mlerp / 0.25), 0, 0.05)) @@ -617,13 +617,13 @@ hook.Add("SetupMove", "BeatrunVaulting", function(ply, mv, cmd) mlerprate = mlerprate * mult end - if CLIENT_IFTP() then + if CLIENT and IsFirstTimePredicted() then ply:CLViewPunch(Angle(0.25 * mlerp / 0.2, -0.05, -0.15)) elseif game.SinglePlayer() then ply:ViewPunch(Angle(0.75 * mlerp / 0.2, -0.25, -0.5)) end elseif mlerp > 0.45 and mlerp < 0.7 then - if CLIENT_IFTP() then + if CLIENT and IsFirstTimePredicted() then ply:CLViewPunch(Angle(-0.15, 0.1, 0.15)) elseif game.SinglePlayer() then ply:ViewPunch(Angle(-0.75, 0.25, 0.5)) @@ -633,13 +633,13 @@ hook.Add("SetupMove", "BeatrunVaulting", function(ply, mv, cmd) ply:SetMantleLerp(math.Approach(mlerp, 1, mlerprate)) elseif mantletype == 3 then if mlerp < 0.45 then - if CLIENT_IFTP() then + if CLIENT and IsFirstTimePredicted() then ply:CLViewPunch(Angle(0.15, 0, 0)) elseif game.SinglePlayer() then ply:ViewPunch(Angle(0.3, 0, 0)) end elseif mlerp > 0.45 and mlerp < 0.8 then - if CLIENT_IFTP() then + if CLIENT and IsFirstTimePredicted() then ply:CLViewPunch(Angle(-0.05, 0, 0)) elseif game.SinglePlayer() then ply:ViewPunch(Angle(-0.25, 0, 0)) @@ -655,14 +655,14 @@ hook.Add("SetupMove", "BeatrunVaulting", function(ply, mv, cmd) mlerprate = 0.03 / TargetTick if mlerp < 0.0575 then - if CLIENT_IFTP() then + if CLIENT and IsFirstTimePredicted() then ply:CLViewPunch(Angle(0.25 * mlerp / 0.2, 0, -0.25)) elseif game.SinglePlayer() then ply:ViewPunch(Angle(0.75 * mlerp / 0.1, 0, -0.5)) end mlerprate = mlerprate * 0.1 - elseif CLIENT_IFTP() then + elseif CLIENT and IsFirstTimePredicted() then ply:CLViewPunch(Angle(-0.05, 0, 0.25 / (mlerp / 0.3))) elseif game.SinglePlayer() then ply:ViewPunch(Angle(-0.15, 0, 0.5 / (mlerp / 0.3))) @@ -677,7 +677,7 @@ hook.Add("SetupMove", "BeatrunVaulting", function(ply, mv, cmd) mlerprate = 0.03 / TargetTick if mlerp < 0.0575 then - if CLIENT_IFTP() then + if CLIENT and IsFirstTimePredicted() then ply:CLViewPunch(Angle(-0.15 * mlerp / 0.1, 0, -0.25)) elseif game.SinglePlayer() then ply:ViewPunch(Angle(0.15 * mlerp / 0.1, 0, -0.5)) @@ -685,7 +685,7 @@ hook.Add("SetupMove", "BeatrunVaulting", function(ply, mv, cmd) mlerprate = mlerprate * 0.1 else - if CLIENT_IFTP() then + if CLIENT and IsFirstTimePredicted() then ply:CLViewPunch(Angle(0.01, 0, 0.5 / (mlerp / 0.15))) elseif game.SinglePlayer() then ply:ViewPunch(Angle(-0.05, 0, 0.5 / (mlerp / 0.3))) @@ -734,7 +734,7 @@ hook.Add("SetupMove", "BeatrunVaulting", function(ply, mv, cmd) end if mv:KeyDown(IN_JUMP) and mantletype < 4 then - if CLIENT_IFTP() then + if CLIENT and IsFirstTimePredicted() then BodyLimitX = 90 BodyLimitY = 180 elseif game.SinglePlayer() then diff --git a/beatrun/gamemodes/beatrun/gamemode/sh/Wallrun.lua b/beatrun/gamemodes/beatrun/gamemode/sh/Wallrun.lua index 58dec61..113ca01 100644 --- a/beatrun/gamemodes/beatrun/gamemode/sh/Wallrun.lua +++ b/beatrun/gamemodes/beatrun/gamemode/sh/Wallrun.lua @@ -423,7 +423,7 @@ local function WallrunningCheck(ply, mv, cmd) ParkourEvent("wallrunv", ply) - if CLIENT_IFTP() then + if CLIENT and IsFirstTimePredicted() then BodyLimitX = 30 BodyLimitY = 70 BodyAnimCycle = 0 diff --git a/beatrun/gamemodes/beatrun/gamemode/sh/WallrunME.lua b/beatrun/gamemodes/beatrun/gamemode/sh/WallrunME.lua index 012b357..93320f3 100644 --- a/beatrun/gamemodes/beatrun/gamemode/sh/WallrunME.lua +++ b/beatrun/gamemodes/beatrun/gamemode/sh/WallrunME.lua @@ -70,7 +70,7 @@ function PuristWallrunningCheck(ply, mv, cmd, vel, eyeang, timemult, speedmult) ParkourEvent("wallrunv", ply) - if CLIENT_IFTP() then + if CLIENT and IsFirstTimePredicted() then BodyLimitX = 30 BodyLimitY = 70 BodyAnimCycle = 0 diff --git a/beatrun/gamemodes/beatrun/gamemode/sh/Zipline.lua b/beatrun/gamemodes/beatrun/gamemode/sh/Zipline.lua index cefcd45..f4c3fa6 100644 --- a/beatrun/gamemodes/beatrun/gamemode/sh/Zipline.lua +++ b/beatrun/gamemodes/beatrun/gamemode/sh/Zipline.lua @@ -104,7 +104,7 @@ local function ZiplineCheck(ply, mv, cmd, zipline) ply:SetZiplineSpeed(math.min(vel:Length(), 750)) ply:SetCrouchJumpBlocked(false) - if CLIENT_IFTP() then + if CLIENT and IsFirstTimePredicted() then -- local zipline = ply:GetZipline() ply.OrigEyeAng = (endpos - startpos):Angle() elseif game.SinglePlayer() then @@ -113,7 +113,7 @@ local function ZiplineCheck(ply, mv, cmd, zipline) net.Send(ply) end - if CLIENT_IFTP() or game.SinglePlayer() then + if CLIENT and IsFirstTimePredicted() or game.SinglePlayer() then ply:EmitSound("ZiplineLoop") ply:EmitSound("ZiplineStart") end @@ -149,7 +149,7 @@ local function ZiplineThink(ply, mv, cmd, zipline) ply:SetZiplineDelay(CurTime() + 0.75) - if CLIENT_IFTP() or game.SinglePlayer() then + if CLIENT and IsFirstTimePredicted() or game.SinglePlayer() then ply:EmitSound("ZiplineEnd") ply:StopSound("ZiplineLoop") @@ -189,7 +189,7 @@ local function ZiplineThink(ply, mv, cmd, zipline) ply:SetZiplineDelay(CurTime() + 0.75) - if CLIENT_IFTP() or game.SinglePlayer() then + if CLIENT and IsFirstTimePredicted() or game.SinglePlayer() then ply:EmitSound("ZiplineEnd") ply:StopSound("ZiplineLoop") diff --git a/beatrun/gamemodes/beatrun/gamemode/sh/sh_freerunsysall.lua b/beatrun/gamemodes/beatrun/gamemode/sh/sh_freerunsysall.lua index 95068eb..40495f7 100644 --- a/beatrun/gamemodes/beatrun/gamemode/sh/sh_freerunsysall.lua +++ b/beatrun/gamemodes/beatrun/gamemode/sh/sh_freerunsysall.lua @@ -128,7 +128,7 @@ hook.Add("PlayerFootstep", "MEStepSound", function(ply, pos, foot, sound, volume ply:EmitSound("Footsteps.Spark") end - if (CLIENT_IFTP() or game.SinglePlayer()) and ply.FootstepLand then + if (CLIENT and IsFirstTimePredicted() or game.SinglePlayer()) and ply.FootstepLand then local landsound = FOOTSTEPS_LAND_LUT[mat] or "Concrete" ply:EmitSound("Land." .. landsound) @@ -157,7 +157,7 @@ hook.Add("OnPlayerHitGround", "MELandSound", function(ply, water, floater, speed ParkourEvent("land", ply) if ply:GetMelee() == MELEE_DROPKICK and ply:GetMeleeTime() < CurTime() and vel:Length() < 300 then - if CLIENT_IFTP() then + if CLIENT and IsFirstTimePredicted() then Hardland(false) elseif SERVER and game.SinglePlayer() then net.Start("Beatrun_HardLand") @@ -185,7 +185,7 @@ hook.Add("OnPlayerHitGround", "MELandSound", function(ply, water, floater, speed ply:SetJumpTurn(true) end - if CLIENT_IFTP() then + if CLIENT and IsFirstTimePredicted() then Hardland(jt) elseif SERVER and game.SinglePlayer() then net.Start("Beatrun_HardLand")