Add discard, discard nades.
This commit is contained in:
parent
9aeddee805
commit
f8cb3fedc5
|
@ -42,6 +42,12 @@ function PT:INV_Get()
|
|||
return self.INV
|
||||
end
|
||||
|
||||
function PT:INV_Discard( id )
|
||||
if self:INV_Get()[ id ] then
|
||||
self:INV_Get()[ id ] = nil
|
||||
end
|
||||
end
|
||||
|
||||
do
|
||||
local translat = {
|
||||
["melee"] = { 1, 1 },
|
||||
|
|
|
@ -928,6 +928,9 @@ do -- Grenades, nothing here is guaranteed.
|
|||
if !class.GrenadeCharge then self:SetGrenadeDownStart( CurTime() ) end
|
||||
self:TPFire()
|
||||
if SERVER then GrenadeThrow( self, data ) end
|
||||
local id = self:D_GetID( false )
|
||||
self:BHolster( false )
|
||||
p:INV_Discard( id )
|
||||
end
|
||||
end
|
||||
return true
|
||||
|
@ -938,6 +941,9 @@ do -- Grenades, nothing here is guaranteed.
|
|||
self:SetGrenadeDown( false )
|
||||
self:TPFire()
|
||||
if SERVER then GrenadeThrow( self, data ) end
|
||||
local id = self:D_GetID( false )
|
||||
self:BHolster( false )
|
||||
p:INV_Discard( id )
|
||||
end
|
||||
return true
|
||||
end
|
||||
|
|
Loading…
Reference in New Issue