Check if the requested weapon exists

This commit is contained in:
Fesiug 2023-12-09 21:29:10 -05:00
parent 928d9a7600
commit bb8743fc28
1 changed files with 4 additions and 1 deletions

View File

@ -226,6 +226,9 @@ function SWEP:Think()
for i=1, 2 do
local hand = i==2
if self:D_GetReqID( hand ) != "" and !inv[self:D_GetReqID( hand )] then
self:D_SetReqID( hand, "" )
end
local req = self:D_GetReqID( hand )
local req_o = self:D_GetReqID( !hand )
local curr = self:D_GetID( hand )
@ -236,7 +239,7 @@ function SWEP:Think()
self:BStartHolster( hand )
else
local otherhasthis = curr_o == req
if req != "" and inv[req] then
if req != "" then
if otherhasthis then
self:BStartHolster( !hand )
else