mirror of
https://github.com/CapsAdmin/pac3.git
synced 2025-03-04 03:03:01 -05:00
fix FallApartOnDeath messing with other players
This commit is contained in:
parent
be5a1c7625
commit
3849b6b9e8
@ -34,7 +34,7 @@ do
|
||||
if not IsEntity(ply) or not ply:IsValid() then return end
|
||||
|
||||
if ply.pac_death_physics_parts and ply:Alive() and ply.pac_physics_died then
|
||||
pac.CallRecursiveOnAllParts("OnBecomePhysics")
|
||||
pac.CallRecursiveOnOwnedParts(ply, "OnBecomePhysics")
|
||||
ply.pac_physics_died = false
|
||||
end
|
||||
|
||||
|
@ -592,6 +592,18 @@ function pac.CallRecursiveOnAllParts(func_name, ...)
|
||||
end
|
||||
end
|
||||
|
||||
function pac.CallRecursiveOnOwnedParts(ent, func_name, ...)
|
||||
local owned_parts = parts_from_ent(ent)
|
||||
for _, part in pairs(owned_parts) do
|
||||
if part[func_name] then
|
||||
local ret = part[func_name](part, ...)
|
||||
if ret ~= nil then
|
||||
return ret
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
function pac.EnablePartsByClass(classname, enable)
|
||||
for _, part in pairs(all_parts) do
|
||||
if part.ClassName == classname then
|
||||
|
Loading…
Reference in New Issue
Block a user