Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix cursor parent using deprecated function #3151

Merged
merged 1 commit into from
Oct 21, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading