From 20e2281e34ebfa3d7fa355a47dd67c537afb2d72 Mon Sep 17 00:00:00 2001 From: Fesiug Date: Sat, 18 Nov 2023 03:52:40 -0500 Subject: [PATCH] Remove annoying prints, camera thing idk --- .../benny/gamemode/modules/player/sh_basic.lua | 2 -- .../gamemode/modules/player/sh_movement.lua | 18 +++++++++++++++--- .../gamemode/modules/weapons/sh_weapons.lua | 9 +++++++++ 3 files changed, 24 insertions(+), 5 deletions(-) diff --git a/gamemodes/benny/gamemode/modules/player/sh_basic.lua b/gamemodes/benny/gamemode/modules/player/sh_basic.lua index b1bbed6..6cd8acb 100644 --- a/gamemodes/benny/gamemode/modules/player/sh_basic.lua +++ b/gamemodes/benny/gamemode/modules/player/sh_basic.lua @@ -48,9 +48,7 @@ end, "arg 1: player ent index, arg 2: classname") concommand.Add("benny_inv_equip", function( ply, cmd, args ) local wep = ply:BennyCheck() if wep then - print(args[2]) local hand = args[2]!=nil and tobool(args[2]) or wep:GetTempHandedness() - print(hand) local id = args[1] local swap_or_replace = tobool(args[3]) diff --git a/gamemodes/benny/gamemode/modules/player/sh_movement.lua b/gamemodes/benny/gamemode/modules/player/sh_movement.lua index c5aa04a..4616b2f 100644 --- a/gamemodes/benny/gamemode/modules/player/sh_movement.lua +++ b/gamemodes/benny/gamemode/modules/player/sh_movement.lua @@ -21,7 +21,14 @@ hook.Add( "PlayerNoClip", "Benny_PlayerNoClip", function( ply, desiredNoClipStat end) hook.Add( "InputMouseApply", "Benny_InputMouseApply", function( cmd, x, y, ang ) - if LocalPlayer():BennyCheck() and !LocalPlayer():NoclippingAndNotVaulting() and GetConVar("benny_cam_override"):GetString() == "" then + local p = LocalPlayer() + local w = p:BennyCheck() + local cdis = false + if w and w:BClass( false ) and w:BClass( false ).Custom_DisableSpecialMovement and w:BClass( false ).Custom_DisableSpecialMovement( w ) then cdis = true end + if w and w:BClass( true ) and w:BClass( true ).Custom_DisableSpecialMovement and w:BClass( true ).Custom_DisableSpecialMovement( w ) then cdis = true end + if GetConVar("benny_cam_override"):GetString() != "" then cdis = true end + if p:NoclippingAndNotVaulting() then cdis = true end + if w and !cdis then TPSOverride:Add( Angle( y*0.022, -x*0.022, 0 ) ) return true end @@ -75,8 +82,13 @@ hook.Add( "CreateMove", "Benny_CreateMove", function( cmd ) end local p = LocalPlayer() - local w = p:GetActiveWeapon() - if p:BennyCheck() and !LocalPlayer():NoclippingAndNotVaulting() and GetConVar("benny_cam_override"):GetString() == "" then -- FPS cam + local w = p:BennyCheck() + local cdis = false + if w:BClass( false ) and w:BClass( false ).Custom_DisableSpecialMovement and w:BClass( false ).Custom_DisableSpecialMovement( w ) then cdis = true end + if w:BClass( true ) and w:BClass( true ).Custom_DisableSpecialMovement and w:BClass( true ).Custom_DisableSpecialMovement( w ) then cdis = true end + if GetConVar("benny_cam_override"):GetString() != "" then cdis = true end + if LocalPlayer():NoclippingAndNotVaulting() then cdis = true end + if w and !cdis then -- FPS cam local aimed = w:GetUserAim() local opos, ang = p:CamSpot( TPSOverride ) diff --git a/gamemodes/benny/gamemode/modules/weapons/sh_weapons.lua b/gamemodes/benny/gamemode/modules/weapons/sh_weapons.lua index 43df519..fd4eb4a 100644 --- a/gamemodes/benny/gamemode/modules/weapons/sh_weapons.lua +++ b/gamemodes/benny/gamemode/modules/weapons/sh_weapons.lua @@ -272,10 +272,19 @@ do -- Toolgun -- Return true to skip weapon logic return true end, + + Custom_DisableSpecialMovement = function( self, data ) + -- Return true to skip weapon logic + if self:GetUserAim() then + return true + end + end, Custom_CalcView = function( self, data ) if self:GetUserAim() and GetConVar("benny_cam_override"):GetString() == "" then data.drawviewer = false + data.origin = self:GetOwner():EyePos() + data.angles = self:GetOwner():EyeAngles() return true -- Return true to halt end