Permalink
Browse files

Don't allow non admins to edit admin only entities

  • Loading branch information...
1 parent a326c5f commit bcf118e4b1c35f8516b7cc070206b9b7e585649c @robotboy655 robotboy655 committed Mar 22, 2016
Showing with 1 addition and 4 deletions.
  1. +1 −4 garrysmod/lua/includes/extensions/entity.lua
@@ -141,9 +141,6 @@ end
hook.Add( "EntityRemoved", "DoDieFunction", DoDieFunction )
---[[---------------------------------------------------------
- Name: PhysWake
------------------------------------------------------------]]
function meta:PhysWake()
local phys = self:GetPhysicsObject()
@@ -458,10 +455,10 @@ function meta:InstallDataTable()
if ( !IsValid( ent ) ) then return end
if ( !isfunction( ent.GetEditingData ) ) then return end
+ if ( ent.AdminOnly && !client:IsAdmin() ) then return end
local key = net.ReadString()
-
-- Is this key in our edit table?
local editor = ent:GetEditingData()[ key ]
if ( !istable( editor ) ) then return end

0 comments on commit bcf118e

Please sign in to comment.