Skip to content

Commit

Permalink
Add CFW_OnParentedTo
Browse files Browse the repository at this point in the history
  • Loading branch information
marchc1 committed Jan 12, 2025
1 parent fd6b189 commit 4fe6b19
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions lua/cfw/core/parenting_sv.lua
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,10 @@ hook.Add("Initialize", "CFW", function()
local validNewParent = IsValid(newParent)
local validOldParent = IsValid(oldParent)

if self.CFW_OnParentedTo and self:CFW_OnParentedTo(oldParent, newParent, newAttach, ...) == false then
return
end

if (validOldParent and oldParent.CFW_OnParented) and not validNewParent then
oldParent:CFW_OnParented(self, false)
end
Expand Down

0 comments on commit 4fe6b19

Please sign in to comment.