Skip to content

Commit

Permalink
Move owner check before checkindex
Browse files Browse the repository at this point in the history
  • Loading branch information
Derpius committed Dec 15, 2023
1 parent aadd9b3 commit 748ec83
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions lua/entities/gmod_wire_expression2/core/hologram.lua
Original file line number Diff line number Diff line change
Expand Up @@ -1224,27 +1224,27 @@ end

e2function void holoParent(index, entity ent)
if not IsValid(ent) then return end
local Holo = CheckIndex(self, index)
if not Holo then return end

if not E2Lib.isOwner(self, ent) then
return self:throw("You do not have permission to parent to this entity", nil)
end

local Holo = CheckIndex(self, index)
if not Holo then return end

if not Check_Parents(Holo.ent, ent) then return end

Parent_Hologram(Holo, ent, nil)
end

e2function void holoParentAttachment(index, entity ent, string attachmentName)
if not IsValid(ent) then return end
local Holo = CheckIndex(self, index)
if not Holo then return end

if not E2Lib.isOwner(self, ent) then
return self:throw("You do not have permission to parent to this entity", nil)
end

local Holo = CheckIndex(self, index)
if not Holo then return end

Parent_Hologram(Holo, ent, attachmentName)
end

Expand Down

0 comments on commit 748ec83

Please sign in to comment.