Check, in case mag disappears somehow
This commit is contained in:
parent
4bc66529f1
commit
3d55f6c7d7
|
@ -107,7 +107,11 @@ function SWEP:Reload( hand )
|
||||||
local mid = self:D_GetMagID( hand )
|
local mid = self:D_GetMagID( hand )
|
||||||
if SERVER or (CLIENT and IsFirstTimePredicted()) then
|
if SERVER or (CLIENT and IsFirstTimePredicted()) then
|
||||||
if mid != "" then
|
if mid != "" then
|
||||||
if inv[mid].Ammo == 0 then
|
if !inv[mid] then
|
||||||
|
ErrorNoHalt( "Mag isn't a valid item" )
|
||||||
|
self:D_SetMagID( hand, "" )
|
||||||
|
wep_table.Loaded = ""
|
||||||
|
elseif inv[mid].Ammo == 0 then
|
||||||
if SERVER or (CLIENT and IsFirstTimePredicted()) then
|
if SERVER or (CLIENT and IsFirstTimePredicted()) then
|
||||||
p:INV_Discard( mid )
|
p:INV_Discard( mid )
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in New Issue