mirror of
https://github.com/ParadiseSS13/Paradise.git
synced 2026-07-15 17:13:46 +01:00
Simplify check_access_list
This commit is contained in:
@@ -172,20 +172,11 @@
|
||||
|
||||
|
||||
/obj/proc/check_access_list(var/list/L)
|
||||
if(!src.req_access && !src.req_one_access) return 1
|
||||
if(!istype(src.req_access, /list)) return 1
|
||||
if(!src.req_access.len && (!src.req_one_access || !src.req_one_access.len)) return 1
|
||||
if(!req_access) req_access = list()
|
||||
if(!req_one_access) req_one_access = list()
|
||||
if(!L) return 0
|
||||
if(!istype(L, /list)) return 0
|
||||
for(var/req in src.req_access)
|
||||
if(!(req in L)) //doesn't have this access
|
||||
return 0
|
||||
if(src.req_one_access && src.req_one_access.len)
|
||||
for(var/req in src.req_one_access)
|
||||
if(req in L) //has an access from the single access list
|
||||
return 1
|
||||
return 0
|
||||
return 1
|
||||
return has_access(req_access, req_one_access, L)
|
||||
|
||||
/proc/has_access(var/list/req_access, var/list/req_one_access, var/list/accesses)
|
||||
for(var/req in req_access)
|
||||
|
||||
Reference in New Issue
Block a user