mirror of
https://github.com/CapsAdmin/pac3.git
synced 2025-03-04 03:03:01 -05:00
Fix cl error and use global IsValid instead (#1257)
* Fix cl error and use global IsValid instead * Newline * Revert usage of global IsValid
This commit is contained in:
parent
0330c223bf
commit
b7658d3d3b
@ -1,5 +1,4 @@
|
||||
pac.OwnerNames =
|
||||
{
|
||||
pac.OwnerNames = {
|
||||
"self",
|
||||
"viewmodel",
|
||||
"hands",
|
||||
@ -117,6 +116,16 @@ function pac.HandleOwnerName(owner, name, ent, part, check_func)
|
||||
if name == "viewmodel" and owner.GetViewModel then
|
||||
return owner:GetViewModel()
|
||||
end
|
||||
|
||||
if IsValid(ent) and (not check_func or check_func(ent)) and check_owner(ent, owner) and find_ent(ent, name) then
|
||||
return ent
|
||||
end
|
||||
|
||||
for _, val in pairs(ents.GetAll()) do
|
||||
if val:IsValid() and (not check_func or check_func(val)) and check_owner(val, owner) and find_ent(val, name) then
|
||||
return val
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
if name:find("persist ", nil, true) then
|
||||
@ -128,15 +137,5 @@ function pac.HandleOwnerName(owner, name, ent, part, check_func)
|
||||
end
|
||||
end
|
||||
|
||||
if IsValid(ent) and (not check_func or check_func(ent)) and check_owner(ent, owner) and find_ent(ent, name) then
|
||||
return ent
|
||||
end
|
||||
|
||||
for _, val in pairs(ents.GetAll()) do
|
||||
if val:IsValid() and (not check_func or check_func(val)) and check_owner(val, owner) and find_ent(val, name) then
|
||||
return val
|
||||
end
|
||||
end
|
||||
|
||||
return NULL
|
||||
end
|
||||
end
|
||||
|
Loading…
Reference in New Issue
Block a user