Prevent the weapon from shooting when pointing at invalid model. See #1 for more info on invalid model.
parent
e5a04781bf
commit
d54d2465e1
|
@ -278,10 +278,16 @@ function SWEP:PrimaryAttack()
|
|||
return false
|
||||
end
|
||||
|
||||
// Make sure the new model is actually marked as a prop
|
||||
if (
|
||||
string.sub(string.lower(entity:GetClass()), 1, 5) != "prop_"
|
||||
&& string.sub(string.lower(entity:GetClass()), -5, -1) != "_prop"
|
||||
&& string.find(string.lower(entity:GetClass()), "_prop_") == nil
|
||||
) then return false end
|
||||
|
||||
// Now let's disguise, shall we?
|
||||
self:DoShootEffect(trace.HitPos, trace.HitNormal, trace.Entity, trace.PhysicsBone, IsFirstTimePredicted())
|
||||
self:Disguise(entity)
|
||||
|
||||
end
|
||||
|
||||
// this is usually triggered on right mouse click
|
||||
|
|
Loading…
Reference in New Issue