mirror of
https://github.com/CHOMPStation2/CHOMPStation2.git
synced 2025-12-10 02:09:41 +00:00
powder that makes you say yes
This commit is contained in:
@@ -1,17 +1,5 @@
|
||||
<<<<<<< HEAD
|
||||
//This file was auto-corrected by findeclaration.exe on 25.5.2012 20:42:31
|
||||
|
||||
/obj/var/list/req_access
|
||||
/obj/var/list/req_one_access
|
||||
||||||| parent of efc60df69d... Merge pull request #10510 from VOREStation/Arokha/memopt
|
||||
//This file was auto-corrected by findeclaration.exe on 25.5.2012 20:42:31
|
||||
|
||||
/obj/var/list/req_access = list()
|
||||
/obj/var/list/req_one_access = list()
|
||||
=======
|
||||
/obj/var/list/req_access
|
||||
/obj/var/list/req_one_access
|
||||
>>>>>>> efc60df69d... Merge pull request #10510 from VOREStation/Arokha/memopt
|
||||
|
||||
//returns 1 if this mob has sufficient access to use this object
|
||||
/obj/proc/allowed(mob/M)
|
||||
@@ -28,15 +16,6 @@
|
||||
return check_access_list(I ? I.GetAccess() : null)
|
||||
|
||||
/obj/proc/check_access_list(var/list/L)
|
||||
<<<<<<< HEAD
|
||||
if(!L) return 0
|
||||
if(!istype(L, /list)) return 0
|
||||
||||||| parent of efc60df69d... Merge pull request #10510 from VOREStation/Arokha/memopt
|
||||
if(!req_access) req_access = list()
|
||||
if(!req_one_access) req_one_access = list()
|
||||
if(!L) return 0
|
||||
if(!istype(L, /list)) return 0
|
||||
=======
|
||||
// We don't require access
|
||||
if(!LAZYLEN(req_access) && !LAZYLEN(req_one_access))
|
||||
return TRUE
|
||||
@@ -46,34 +25,9 @@
|
||||
return FALSE
|
||||
|
||||
// Run list comparisons
|
||||
>>>>>>> efc60df69d... Merge pull request #10510 from VOREStation/Arokha/memopt
|
||||
return has_access(req_access, req_one_access, L)
|
||||
|
||||
/proc/has_access(var/list/req_access, var/list/req_one_access, var/list/accesses)
|
||||
<<<<<<< HEAD
|
||||
var/has_RA = LAZYLEN(req_access)
|
||||
var/has_ROA = LAZYLEN(req_one_access)
|
||||
var/has_A = LAZYLEN(accesses)
|
||||
if(!has_RA && !has_ROA) //we need none
|
||||
return TRUE
|
||||
if(!has_A) //we need them but don't have them
|
||||
return FALSE
|
||||
if(has_RA && length(req_access - accesses)) //we don't have every access we need
|
||||
return FALSE
|
||||
if(has_ROA && !length(req_one_access & accesses)) //we have atleast one access from this list
|
||||
return FALSE
|
||||
return TRUE
|
||||
||||||| parent of efc60df69d... Merge pull request #10510 from VOREStation/Arokha/memopt
|
||||
for(var/req in req_access)
|
||||
if(!(req in accesses)) //doesn't have this access
|
||||
return 0
|
||||
if(req_one_access.len)
|
||||
for(var/req in req_one_access)
|
||||
if(req in accesses) //has an access from the single access list
|
||||
return 1
|
||||
return 0
|
||||
return 1
|
||||
=======
|
||||
// Doesn't have access lists, always works
|
||||
if(!LAZYLEN(req_access) && !LAZYLEN(req_one_access))
|
||||
return TRUE
|
||||
@@ -100,7 +54,6 @@
|
||||
|
||||
// Didn't find anything that matched
|
||||
return FALSE
|
||||
>>>>>>> efc60df69d... Merge pull request #10510 from VOREStation/Arokha/memopt
|
||||
|
||||
/proc/get_centcom_access(job)
|
||||
switch(job)
|
||||
@@ -318,4 +271,4 @@ proc/get_all_job_icons() //For all existing HUD icons
|
||||
else
|
||||
return
|
||||
|
||||
return "Unknown" //Return unknown if none of the above apply
|
||||
return "Unknown" //Return unknown if none of the above apply
|
||||
|
||||
Reference in New Issue
Block a user