Fix to prop ragdoll tool not being able to remove props from the ragdoll creation list properly

This commit is contained in:
penolakushari 2023-12-31 12:04:31 +03:00
parent cdffb230a4
commit 2a3dc2a3ba

View File

@ -552,10 +552,10 @@ local function AddPRNode(parent, node)
end)
PRUI.PRTree.Nodes[id].OnRemove = function()
if not PRUI.PRTree.Nodes[id] then return end
node.used = false
node:SetIcon("icon16/brick.png")
PRUI.PRTree.Bones = PRUI.PRTree.Bones - 1
if not PRUI.PRTree.Nodes[id] then return end -- after some gmod update it seems like on remove is being called after the Nodes thing is emptied?
PRUI.PRTree.Nodes[id] = nil
end