Skip to content

Commit

Permalink
Fix cursor parent using deprecated function (#3151)
Browse files Browse the repository at this point in the history
  • Loading branch information
Denneisk authored Oct 21, 2024
1 parent db13718 commit 1335bfa
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions lua/entities/gmod_wire_egp/lib/egplib/parenting.lua
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,7 @@ function EGP:SetParent( Ent, index, parentindex )
end
if (bool) then
if (parentindex == -1) then -- Parent to cursor?
if (self:EditObject( v, { parent = parentindex } )) then return true, v end
if (v:Set("parent", parentindex)) then return true, v end
else
if isnumber(parentindex) then
bool = hasObject(Ent, parentindex)
Expand All @@ -226,7 +226,7 @@ function EGP:SetParent( Ent, index, parentindex )
if (bool) then
EGP:AddParentIndexes( v )

if (SERVER) then parentindex = math.Clamp(parentindex,1,self.ConVars.MaxObjects:GetInt()) end
if (SERVER) then parentindex = math.Clamp(parentindex,1,EGP.ConVars.MaxObjects:GetInt()) end

-- If it's already parented to that object
if (v.parent and v.parent == parentindex) then return false end
Expand Down Expand Up @@ -278,4 +278,4 @@ function EGP:UnParent( Ent, index )

if v:EditObject(data) then return true, v end
end
end
end

0 comments on commit 1335bfa

Please sign in to comment.