more handedness bullsh

This commit is contained in:
Fesiug 2023-11-16 22:30:17 -05:00
parent 95b96ddb7b
commit 97d5939b91
7 changed files with 22 additions and 22 deletions

View File

@ -22,7 +22,7 @@ function SWEP:BFire( hand )
self:B_Ammo( hand, self:D_GetClip( hand ) - 1 )
B_Sound( self, wep_class.Sound_Fire )
self:TPFire()
self:TPFire( self:GetTempHandedness() )
self:CallFire( hand )
self:D_SetDelay( hand, CurTime() + wep_class.Delay )

View File

@ -112,33 +112,33 @@ SWEP.GestureFire = { ACT_HL2MP_GESTURE_RANGE_ATTACK_SHOTGUN, 0.85 }
SWEP.GestureReload = { ACT_FLINCH_STOMACH, 0.3 }
SWEP.GestureDraw = { ACT_GMOD_GESTURE_MELEE_SHOVE_1HAND, 0.75 }
SWEP.GestureHolster = { ACT_GMOD_GESTURE_MELEE_SHOVE_1HAND, 0.65 }
function SWEP:TPFire()
function SWEP:TPFire( hand )
if CLIENT and !IsFirstTimePredicted() then return end
local target = self:BClass( false ).GestureFire
local target = self:BClass( hand ) and self:BClass( hand ).GestureFire
if !target then
target = self.GestureFire
end
self:GetOwner():AddVCDSequenceToGestureSlot( GESTURE_SLOT_GRENADE, self:GetOwner():SelectWeightedSequence(target[1]), target[2], true )
end
function SWEP:TPReload()
function SWEP:TPReload( hand )
if CLIENT and !IsFirstTimePredicted() then return end
local target = self:BClass( false ).GestureReload
local target = self:BClass( hand ) and self:BClass( hand ).GestureReload
if !target then
target = self.GestureReload
end
self:GetOwner():AddVCDSequenceToGestureSlot( GESTURE_SLOT_GRENADE, self:GetOwner():SelectWeightedSequence(target[1]), target[2], true )
end
function SWEP:TPDraw()
function SWEP:TPDraw( hand )
if CLIENT and !IsFirstTimePredicted() then return end
local target = self:BClass( false ).GestureDraw
local target = self:BClass( hand ) and self:BClass( hand ).GestureDraw
if !target then
target = self.GestureDraw
end
self:GetOwner():AddVCDSequenceToGestureSlot( GESTURE_SLOT_GRENADE, self:GetOwner():SelectWeightedSequence(target[1]), target[2], true )
end
function SWEP:TPHolster()
function SWEP:TPHolster( hand )
if CLIENT and !IsFirstTimePredicted() then return end
local target = self:BClass( false ) and self:BClass( false ).GestureHolster
local target = self:BClass( hand ) and self:BClass( hand ).GestureHolster
if !target then
target = self.GestureHolster
end

View File

@ -153,7 +153,7 @@ function SWEP:Reload()
B_Sound( self, "Common.NoAmmo" )
end
end
self:TPReload()
self:TPReload( self:GetTempHandedness() )
end
-- end
end
@ -196,9 +196,9 @@ function SWEP:Think()
end
if ht == "normal" and self:GetHoldType() != "normal" then
self:TPHolster()
self:TPHolster( self:GetTempHandedness() )
elseif ht != "normal" and self:GetHoldType() == "normal" then
self:TPDraw()
self:TPDraw( self:GetTempHandedness() )
end
if self:BClass( false ) then

View File

@ -503,7 +503,7 @@ hook.Add( "HUDPaint", "Benny_HUDPaint", function()
for n, bucket in ipairs( inventorylist ) do
for i, v in ipairs( bucket ) do
if v == wep:D_GetID( false ) then
if v == wep:D_GetID( wep:GetTempHandedness() ) then
bucket_selected = n
item_selected = i
end
@ -541,7 +541,7 @@ hook.Add( "HUDPaint", "Benny_HUDPaint", function()
else
for d, item in ipairs( bucket ) do
local idata = WEAPONS[inv[item].Class]
local sel = item==wep:D_GetID( false )--d==item_selected
local sel = item==wep:D_GetID( wep:GetTempHandedness() )--d==item_selected
surface.SetDrawColor( scheme["bg"] )
surface.DrawRect( bump + b, (item_start+ybump) + b, size_textx, (sel and size_texty_sel or size_texty) )
if sel then
@ -727,7 +727,7 @@ hook.Add( "HUDPaint", "Benny_HUDPaint", function()
end
end
if true and p:BennyCheck() then
if false and p:BennyCheck() then
local bx, by = sw/2, sh*(0.75)
local mx = 50
@ -804,7 +804,7 @@ do
["invnext"] = function( ply )
if !ply:BennyCheck() then return end
local buckets = ply:INV_Buckets()
local currsel = ply:GetActiveWeapon():GetWep1()
local currsel = ply:GetActiveWeapon():D_GetID( ply:GetActiveWeapon():GetTempHandedness() )
local lb, li = Locate( ply, buckets, currsel )
if lb then
@ -828,7 +828,7 @@ do
end,
["invprev"] = function( ply )
local buckets = ply:INV_Buckets()
local currsel = ply:GetActiveWeapon():GetWep1()
local currsel = ply:GetActiveWeapon():D_GetID( ply:GetActiveWeapon():GetTempHandedness() )
local lb, li = Locate( ply, buckets, currsel )
if lb then

View File

@ -61,7 +61,7 @@ end, "arg 1: item id, arg 2 does offhand")
-- PROTO: Move this all into weapon code.
concommand.Add("benny_inv_holster", function( ply, cmd, args )
if ply:BennyCheck() then ply:GetActiveWeapon():BHolster( false ) end
if ply:BennyCheck() then ply:GetActiveWeapon():BHolster( ply:GetActiveWeapon():GetTempHandedness() ) end
end)
concommand.Add("benny_inv_sync", function( ply, cmd, args )

View File

@ -187,10 +187,10 @@ hook.Add("StartCommand", "Benny_INV_StartCommand", function( ply, cmd )
cmd:SetUpMove( inv_bucketlist_flipped[ ply.CLIENTDESIRE ] )
end
local id = cmd:GetUpMove()
local hand = wep:GetTempHandedness()
if id > 0 and inv_bucketlist[id] and inv[inv_bucketlist[id]] then
wep:BDeploy( false, inv_bucketlist[ id ] )
if CLIENT and (wep:D_GetID( false ) == ply.CLIENTDESIRE) then
wep:BDeploy( hand, inv_bucketlist[ id ] )
if CLIENT and (wep:D_GetID( hand ) == ply.CLIENTDESIRE) then
ply.CLIENTDESIRE = 0
print("Fixed")
end

View File

@ -925,7 +925,7 @@ do -- Grenades, nothing here is guaranteed.
-- TEMP: Do this right!
if !class.GrenadeCharge then self:SetGrenadeDownStart( CurTime() ) end
--
self:TPFire()
self:TPFire( self:GetTempHandedness() )
if SERVER then GrenadeCreate( self, data ) end
local id = self:D_GetID( false )
self:BHolster( false )