mirror of
https://github.com/CapsAdmin/pac3.git
synced 2025-03-04 03:03:01 -05:00
Prevent multiple clip parts calling SetupBones on the same model
This commit is contained in:
parent
4e8eb09f16
commit
4d8e6d8c99
@ -42,7 +42,11 @@ do
|
||||
|
||||
-- this fixes clip planes lagging behind when parented to a bone on a model part
|
||||
local owner = self:GetParentOwner()
|
||||
if owner:IsValid() and owner.PACPart then
|
||||
if owner:IsValid() and not owner.pac_clip_bonessetup and owner.PACPart then
|
||||
-- in case there are multiple clips on one model part, only the first one needs to call SetupBones
|
||||
self.pac_clip_owner = owner
|
||||
owner.pac_clip_bonessetup = true
|
||||
|
||||
pac.SetupBones(owner)
|
||||
end
|
||||
|
||||
@ -55,6 +59,11 @@ do
|
||||
local render_PopCustomClipPlane = render.PopCustomClipPlane
|
||||
|
||||
function PART:PostOnDraw()
|
||||
if self.pac_clip_owner then
|
||||
self.pac_clip_owner.pac_clip_bonessetup = nil
|
||||
self.pac_clip_owner = nil
|
||||
end
|
||||
|
||||
render_PopCustomClipPlane()
|
||||
|
||||
render_EnableClipping(bclip)
|
||||
|
Loading…
Reference in New Issue
Block a user