Add discard, discard nades.

This commit is contained in:
Fesiug 2023-11-14 01:12:55 -05:00
parent 9aeddee805
commit f8cb3fedc5
2 changed files with 12 additions and 0 deletions

View File

@ -42,6 +42,12 @@ function PT:INV_Get()
return self.INV return self.INV
end end
function PT:INV_Discard( id )
if self:INV_Get()[ id ] then
self:INV_Get()[ id ] = nil
end
end
do do
local translat = { local translat = {
["melee"] = { 1, 1 }, ["melee"] = { 1, 1 },

View File

@ -928,6 +928,9 @@ do -- Grenades, nothing here is guaranteed.
if !class.GrenadeCharge then self:SetGrenadeDownStart( CurTime() ) end if !class.GrenadeCharge then self:SetGrenadeDownStart( CurTime() ) end
self:TPFire() self:TPFire()
if SERVER then GrenadeThrow( self, data ) end if SERVER then GrenadeThrow( self, data ) end
local id = self:D_GetID( false )
self:BHolster( false )
p:INV_Discard( id )
end end
end end
return true return true
@ -938,6 +941,9 @@ do -- Grenades, nothing here is guaranteed.
self:SetGrenadeDown( false ) self:SetGrenadeDown( false )
self:TPFire() self:TPFire()
if SERVER then GrenadeThrow( self, data ) end if SERVER then GrenadeThrow( self, data ) end
local id = self:D_GetID( false )
self:BHolster( false )
p:INV_Discard( id )
end end
return true return true
end end