File tree Expand file tree Collapse file tree 1 file changed +4
-12
lines changed
lua/starfall/permissions/providers_sh Expand file tree Collapse file tree 1 file changed +4
-12
lines changed Original file line number Diff line number Diff line change @@ -195,21 +195,13 @@ setmetatable(EntityPermissionCache, EntityPermissionCache)
195195
196196local cacheMeta = {__mode = " k" , __index = function (t ,k ) local r = EntityPermissionCache () t [k ]= r return r end }
197197
198- local function getEntPermCache (ent_tbl , instance )
199- local cache = ent_tbl .SF_EntPermCache
200- if not cache then
201- cache = setmetatable ({}, cacheMeta )
202- ent_tbl .SF_EntPermCache = cache
203- end
204- return cache [instance ]
205- end
206- SF .GetEntPermCache = getEntPermCache
198+ local entPermCaches = SF .EntityTable (" entPermCache" )
199+ getmetatable (entPermCaches ).__index = function (t , k ) local r = setmetatable ({}, cacheMeta ) t [k ]= r return r end
207200
208201local function check (instance , ent , checkfunc )
209- local ent_tbl = Ent_GetTable (ent )
210- if not ent_tbl then return false , " Entity is invalid" end
202+ if not Ent_IsValid (ent ) then return false , " Entity is invalid" end
211203 if Ply_IsSuperAdmin (instance .player ) then return true end
212- return getEntPermCache ( ent_tbl , instance ) :check (instance , ent , checkfunc )
204+ return entPermCaches [ ent ][ instance ] :check (instance , ent , checkfunc )
213205end
214206
215207SF .Permissions .registerProvider ({
You can’t perform that action at this time.
0 commit comments