Add discard, discard nades.
This commit is contained in:
parent
9aeddee805
commit
f8cb3fedc5
|
@ -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 },
|
||||||
|
|
|
@ -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
|
||||||
|
|
Loading…
Reference in New Issue