Improvements to Deploy & Holster

This commit is contained in:
Fesiug 2023-11-13 19:28:18 -05:00
parent 043bf4113e
commit 208a995d02
1 changed files with 10 additions and 0 deletions

View File

@ -27,6 +27,11 @@ function SWEP:DSetWepClip( hand, value )
end end
function SWEP:BDeploy( hand, id ) function SWEP:BDeploy( hand, id )
if self:DGetWep( hand ) == id then
return -- PROTO: If you're in the middle of holstering, cancel it
elseif self:DGetWep( hand ) != "" then
self:BHolster( hand )
end
local p = self:GetOwner() local p = self:GetOwner()
local inv = p:INV_Get() local inv = p:INV_Get()
@ -45,10 +50,15 @@ function SWEP:BDeploy( hand, id )
end end
self:DSetClip( hand, item.Loaded == 0 and 0 or item[ "Ammo" .. item.Loaded ] ) self:DSetClip( hand, item.Loaded == 0 and 0 or item[ "Ammo" .. item.Loaded ] )
else
self:DSetClip( hand, 0 )
end end
end end
function SWEP:BHolster( hand ) function SWEP:BHolster( hand )
if self:DGetWep( hand ) == "" then
return -- What the hell are you holstering..?
end
local p = self:GetOwner() local p = self:GetOwner()
local inv = p:INV_Get() local inv = p:INV_Get()