Skip to content

Commit

Permalink
Merge pull request #1 from TAServers/holoparent-cppi
Browse files Browse the repository at this point in the history
Add ownership checks to hololib parent functions
  • Loading branch information
Derpius authored Dec 20, 2023
2 parents 066998c + 748ec83 commit c4de896
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions lua/entities/gmod_wire_expression2/core/hologram.lua
Original file line number Diff line number Diff line change
Expand Up @@ -1224,6 +1224,10 @@ end

e2function void holoParent(index, entity ent)
if not IsValid(ent) 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

Expand All @@ -1234,6 +1238,10 @@ end

e2function void holoParentAttachment(index, entity ent, string attachmentName)
if not IsValid(ent) 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

Expand Down

0 comments on commit c4de896

Please sign in to comment.