Fixes for deagle left hand grenade right hand

This commit is contained in:
Fesiug 2023-12-08 00:28:34 -05:00
parent b0e688bf2f
commit cece2b0e36
3 changed files with 15 additions and 10 deletions

View File

@ -59,7 +59,7 @@ function SWEP:BFire( hand )
if CLIENT and IsFirstTimePredicted() then if CLIENT and IsFirstTimePredicted() then
if IsValid(self.CWM) then if IsValid(self.CWM) and self.CWM:GetAttachment( 1 ) then
local vStart = self.CWM:GetAttachment( 1 ).Pos local vStart = self.CWM:GetAttachment( 1 ).Pos
--local vPoint = p:GetEyeTrace().HitPos --local vPoint = p:GetEyeTrace().HitPos
--local effectdata = EffectData() --local effectdata = EffectData()

View File

@ -211,11 +211,15 @@ function SWEP:Think()
self:SetWep2_Burst( 0 ) self:SetWep2_Burst( 0 )
end end
if wep1 and self:D_GetDelay( false ) < CurTime()-0.01 then for i=1, 2 do
local mweh = math.Remap( CurTime(), self:D_GetShotTime( false ), self:D_GetShotTime( false )+wep1c.SpreadDecay_RampTime, 0, 1 ) local hand = i==2
local wep, wepc = self:BTable( hand ), self:BClass( hand )
if wepc and wepc.Features == "firearm" and self:D_GetDelay( hand ) < CurTime()-0.01 then
local mweh = math.Remap( CurTime(), self:D_GetShotTime( hand ), self:D_GetShotTime( hand )+wepc.SpreadDecay_RampTime, 0, 1 )
mweh = math.Clamp( mweh, 0, 1 ) mweh = math.Clamp( mweh, 0, 1 )
local decayfinal = Lerp( math.ease.InExpo( mweh ), wep1c.SpreadDecay_Start, wep1c.SpreadDecay_End ) local decayfinal = Lerp( math.ease.InExpo( mweh ), wepc.SpreadDecay_Start, wepc.SpreadDecay_End )
self:D_SetSpread( false, math.Approach( self:D_GetSpread( false ), 0, decayfinal * FrameTime() ) ) self:D_SetSpread( hand, math.Approach( self:D_GetSpread( hand ), 0, decayfinal * FrameTime() ) )
end
end end
local ht = "normal" local ht = "normal"

View File

@ -535,11 +535,12 @@ hook.Add( "HUDPaint", "Benny_HUDPaint", function()
end end
end end
if wep:GetUserAim() and wep:BClass( false ) then -- Crosshair local meow = wep:C_DualCheck()
if wep:GetUserAim() and wep:BClass( meow ) and wep:BClass( meow ).Spread then -- Crosshair
local s, w, h = ss, ScrW(), ScrH() local s, w, h = ss, ScrW(), ScrH()
local pl_x, pl_y = w/2, h/2 local pl_x, pl_y = w/2, h/2
local dispersion = math.rad( wep:BSpread( false ) ) local dispersion = math.rad( wep:BSpread( meow ) )
cam.Start3D() cam.Start3D()
local lool = ( EyePos() + ( EyeAngles():Forward()*8192 ) + ( dispersion * EyeAngles():Up()*8192 ) ) :ToScreen() local lool = ( EyePos() + ( EyeAngles():Forward()*8192 ) + ( dispersion * EyeAngles():Up()*8192 ) ) :ToScreen()
cam.End3D() cam.End3D()
@ -592,7 +593,7 @@ hook.Add( "HUDPaint", "Benny_HUDPaint", function()
local mat1 = i == 1 and mat_long_s or mat_long local mat1 = i == 1 and mat_long_s or mat_long
local mat2 = i == 1 and mat_dot_s or mat_dot local mat2 = i == 1 and mat_dot_s or mat_dot
surface.SetDrawColor( cooler ) surface.SetDrawColor( cooler )
if wep:BClass( false ).Type == "rifle" then if wep:BClass( meow ).Type == "rifle" then
surface.SetMaterial( mat1 ) surface.SetMaterial( mat1 )
surface.DrawTexturedRectRotated( poosx - s(spacer_long) - gap, poosy, s(32), s(32), 0 ) surface.DrawTexturedRectRotated( poosx - s(spacer_long) - gap, poosy, s(32), s(32), 0 )
surface.DrawTexturedRectRotated( poosx + s(spacer_long) + gap, poosy, s(32), s(32), 0 ) surface.DrawTexturedRectRotated( poosx + s(spacer_long) + gap, poosy, s(32), s(32), 0 )
@ -600,7 +601,7 @@ hook.Add( "HUDPaint", "Benny_HUDPaint", function()
surface.SetMaterial( mat2 ) surface.SetMaterial( mat2 )
surface.DrawTexturedRectRotated( poosx, poosy - gap - s(spacer), s(32), s(32), 0 ) surface.DrawTexturedRectRotated( poosx, poosy - gap - s(spacer), s(32), s(32), 0 )
surface.DrawTexturedRectRotated( poosx, poosy + gap + s(spacer), s(32), s(32), 0 ) surface.DrawTexturedRectRotated( poosx, poosy + gap + s(spacer), s(32), s(32), 0 )
elseif wep:BClass( false ).Type == "smg" then elseif wep:BClass( meow ).Type == "smg" then
surface.SetMaterial( mat1 ) surface.SetMaterial( mat1 )
surface.DrawTexturedRectRotated( poosx, poosy + gap + s(spacer_long), s(32), s(32), 90 ) surface.DrawTexturedRectRotated( poosx, poosy + gap + s(spacer_long), s(32), s(32), 90 )
surface.DrawTexturedRectRotated( poosx - (math.sin(math.rad(45))*gap) - (math.sin(math.rad(45))*s(spacer_long)), poosy - (math.sin(math.rad(45))*gap) - (math.sin(math.rad(45))*s(spacer_long)), s(32), s(32), -45 ) surface.DrawTexturedRectRotated( poosx - (math.sin(math.rad(45))*gap) - (math.sin(math.rad(45))*s(spacer_long)), poosy - (math.sin(math.rad(45))*gap) - (math.sin(math.rad(45))*s(spacer_long)), s(32), s(32), -45 )