diff --git a/beatrun/gamemodes/beatrun/gamemode/sh/Grapple.lua b/beatrun/gamemodes/beatrun/gamemode/sh/Grapple.lua index 3121394..aa9c94c 100644 --- a/beatrun/gamemodes/beatrun/gamemode/sh/Grapple.lua +++ b/beatrun/gamemodes/beatrun/gamemode/sh/Grapple.lua @@ -85,6 +85,7 @@ hook.Add("SetupMove", "Grapple", function(ply, mv, cmd) ply:SetJumpTurn(false) ply:SetCrouchJumpBlocked(false) ply:SetNW2Entity("grappleEntity", trout.Entity) + ply:SetNW2Bool("grappledNonCourse", true) if CLIENT_IFTP() or game.SinglePlayer() then ply:EmitSound("MirrorsEdge/Gadgets/ME_Magrope_Fire.wav", 40, 100 + math.random(-25, 10)) @@ -107,7 +108,7 @@ hook.Add("SetupMove", "Grapple", function(ply, mv, cmd) local ent = ply:GetNW2Entity("grappleEntity") - local is_ent_invalid = (ent == NULL or ent == nil) + local is_ent_invalid = (ent == NULL or ent == nil) and ply:GetNW2Bool("grappledNonCourse") local is_getting_off = (not ply:Alive() or mv:KeyPressed(IN_JUMP) and not grappled and not ply:OnGround() or ply:GetClimbing() ~= 0 or ply:GetMantle() ~= 0 or not usingrh) local c_delta = 0 if not is_ent_invalid then @@ -122,6 +123,8 @@ hook.Add("SetupMove", "Grapple", function(ply, mv, cmd) ent:SetNWVector("gpos", nil) end + ply:SetNW2Bool("grappledNonCourse", false) + ply:SetGrappling(false) if CLIENT_IFTP() or game.SinglePlayer() then @@ -147,7 +150,7 @@ hook.Add("SetupMove", "Grapple", function(ply, mv, cmd) return end - if ent:GetClass() ~= "worldspawn" then + if ply:GetNW2Bool("grappledNonCourse") and ent:GetClass() ~= "worldspawn" then ent:SetNWVector("glastpos", ent:GetNWVector("gpos", ent:GetPos())) ent:SetNWVector("gpos", ent:GetPos()) local delta = ent:GetNWVector("gpos", Vector(0,0,0)) - ent:GetNWVector("glastpos", Vector(0, 0, 0)) diff --git a/beatrun/gamemodes/beatrun/gamemode/sh/sh_buildmode.lua b/beatrun/gamemodes/beatrun/gamemode/sh/sh_buildmode.lua index 67f7f3e..e064dd8 100644 --- a/beatrun/gamemodes/beatrun/gamemode/sh/sh_buildmode.lua +++ b/beatrun/gamemodes/beatrun/gamemode/sh/sh_buildmode.lua @@ -743,6 +743,8 @@ if CLIENT then local ziplinemins = Vector(-8, -8, -8) local ziplinemaxs = Vector(8, 8, 8) + local placedistance = 1000 + surface.CreateFont("BuildMode", { shadow = false, blursize = 0, @@ -824,8 +826,21 @@ if CLIENT then aimvector = util.AimVector(eyeang, 133, mousex, mousey, ScrW(), ScrH()) + + local dmult = 1 + + if input.IsKeyDown(KEY_LALT) then dmult = 0.1 end + + if input.IsKeyDown(KEY_EQUAL) then + placedistance = math.min(placedistance + 100 * FrameTime() * dmult, inf) + end + + if input.IsKeyDown(KEY_MINUS) then + placedistance = math.max(placedistance - 100 * FrameTime() * dmult, 0) + end + trace.start = eyepos - trace.endpos = eyepos + aimvector * (not PlaceStartPos and 100000 or PlaceStartPos:Distance(ply:GetPos())) + trace.endpos = eyepos + aimvector * (not PlaceStartPos and placedistance or PlaceStartPos:Distance(ply:GetPos())) trace.filter = ply trace.output = tracer