From 791463cd615ec9382b2ce6bfb354d6b40ca9d23d Mon Sep 17 00:00:00 2001 From: AlmTech Software Date: Fri, 17 Jan 2020 21:28:10 +0100 Subject: [PATCH] Bug fix for developer tools --- entities/weapons/quantum_hands/shared.lua | 23 +++++++++++++---------- 1 file changed, 13 insertions(+), 10 deletions(-) diff --git a/entities/weapons/quantum_hands/shared.lua b/entities/weapons/quantum_hands/shared.lua index 76a618c..e14f494 100644 --- a/entities/weapons/quantum_hands/shared.lua +++ b/entities/weapons/quantum_hands/shared.lua @@ -32,16 +32,17 @@ if CLIENT then hook.Add( "PostDrawOpaqueRenderables", "Quantum_Client_DeveloperHands_HitPos", function() if( LocalPlayer():IsSuperAdmin() ) then - local trace = LocalPlayer():GetEyeTrace() - local angle = trace.HitNormal:Angle() - - render.SetMaterial( cubeMat ) - render.DrawBox( trace.HitPos, Angle( 0, 0, 0), Vector( 0, 0, 0 ), Vector( 2, 2, 2 ), Color( 255, 255, 255 ) ) - - render.DrawLine( trace.HitPos, trace.HitPos + 12 * angle:Forward(), Color( 255, 0, 0 ), true ) - render.DrawLine( trace.HitPos, trace.HitPos + 12 * -angle:Right(), Color( 0, 255, 0 ), true ) - render.DrawLine( trace.HitPos, trace.HitPos + 12 * angle:Up(), Color( 0, 0, 255 ), true ) - + if( LocalPlayer():GetActiveWeapon():GetClass() == "quantum_hands" ) then + local trace = LocalPlayer():GetEyeTrace() + local angle = trace.HitNormal:Angle() + + render.SetMaterial( cubeMat ) + render.DrawBox( trace.HitPos, Angle( 0, 0, 0), Vector( 0, 0, 0 ), Vector( 2, 2, 2 ), Color( 255, 255, 255 ) ) + + render.DrawLine( trace.HitPos, trace.HitPos + 12 * angle:Forward(), Color( 255, 0, 0 ), true ) + render.DrawLine( trace.HitPos, trace.HitPos + 12 * -angle:Right(), Color( 0, 255, 0 ), true ) + render.DrawLine( trace.HitPos, trace.HitPos + 12 * angle:Up(), Color( 0, 0, 255 ), true ) + end end end) end @@ -92,6 +93,7 @@ function SWEP:PrimaryAttack() end else if( LocalPlayer():IsSuperAdmin() ) then + LocalPlayer():ChatPrint( "Check console for output.\n" ) Quantum.Debug( "--Hitpos Data--" ) print( translateVector( "Vector", LocalPlayer():GetEyeTrace().HitPos ) ) print( translateVector( "Angle", LocalPlayer():GetAngles() ) ) @@ -103,6 +105,7 @@ end function SWEP:SecondaryAttack() if CLIENT then if( LocalPlayer():IsSuperAdmin() ) then + LocalPlayer():ChatPrint( "Check console for output.\n" ) Quantum.Debug( "--Camera Data--" ) print( translateVector( "Vector", LocalPlayer():GetPos() ) ) print( translateVector( "Angle", LocalPlayer():GetAngles() ) )