mirror of
https://github.com/Aurorastation/Aurora.3.git
synced 2026-08-21 20:11:04 +01:00
Merge pull request #1058 from SkyMarshal/BugFixes
Made req_access work like req_one_access used to; req_combined_access is now used for when you need more than one type of access to be checked together. Adjusted maps to reflect this.
This commit is contained in:
@@ -22,7 +22,7 @@
|
||||
/obj/item/tape/engineering
|
||||
name = "engineering tape"
|
||||
desc = "A length of engineering tape. Better not cross it."
|
||||
req_one_access = list(access_engine,access_atmospherics)
|
||||
req_access = list(access_engine,access_atmospherics)
|
||||
icon_base = "engineering"
|
||||
|
||||
/obj/item/taperoll/attack_self(mob/user as mob)
|
||||
|
||||
+45
-37
@@ -82,28 +82,29 @@
|
||||
|
||||
/obj/var/list/req_access = null
|
||||
/obj/var/req_access_txt = "0"
|
||||
/obj/var/list/req_one_access = null
|
||||
/obj/var/req_one_access_txt = "0"
|
||||
|
||||
/obj/var/list/req_combined_access = null
|
||||
/obj/var/req_combined_access_txt = "0"
|
||||
|
||||
/obj/New()
|
||||
//NOTE: If a room requires more than one access (IE: Morgue + medbay) set the req_acesss_txt to "5;6" if it requires 5 and 6
|
||||
if(src.req_access_txt)
|
||||
if(req_access_txt)
|
||||
var/list/req_access_str = dd_text2list(req_access_txt,";")
|
||||
if(!req_access)
|
||||
req_access = list()
|
||||
for(var/x in req_access_str)
|
||||
var/n = text2num(x)
|
||||
if(n)
|
||||
req_access += n
|
||||
req_access |= n
|
||||
|
||||
if(src.req_one_access_txt)
|
||||
var/list/req_one_access_str = dd_text2list(req_one_access_txt,";")
|
||||
if(!req_one_access)
|
||||
req_one_access = list()
|
||||
for(var/x in req_one_access_str)
|
||||
if(req_combined_access_txt)
|
||||
var/list/req_access_str = dd_text2list(req_combined_access_txt,";")
|
||||
if(!req_combined_access)
|
||||
req_combined_access = list()
|
||||
for(var/x in req_access_str)
|
||||
var/n = text2num(x)
|
||||
if(n)
|
||||
req_one_access += n
|
||||
req_combined_access |= n
|
||||
|
||||
..()
|
||||
|
||||
@@ -133,40 +134,47 @@
|
||||
var/obj/item/device/pda/pda = I
|
||||
I = pda.id
|
||||
|
||||
if(!src.req_access && !src.req_one_access) //no requirements
|
||||
if(!req_access) //no requirements
|
||||
return 1
|
||||
if(!istype(src.req_access, /list)) //something's very wrong
|
||||
return 1
|
||||
|
||||
var/list/L = src.req_access
|
||||
if(!L.len && (!src.req_one_access || !src.req_one_access.len)) //no requirements
|
||||
if(!istype(req_access, /list)) //something's very wrong
|
||||
return 1
|
||||
if(!req_access.len) //no requirements
|
||||
if(!req_combined_access || !islist(req_combined_access) || !req_combined_access.len)
|
||||
return 1
|
||||
if(!I || !istype(I, /obj/item/weapon/card/id) || !I.access) //not ID or no access
|
||||
return 0
|
||||
if(src.req_one_access && src.req_one_access.len)
|
||||
for(var/req in src.req_one_access)
|
||||
if(req in I.access) //has an access from the single access list
|
||||
return 1
|
||||
for(var/req in src.req_access)
|
||||
if(!(req in I.access)) //doesn't have this access - Leave like this DMTG
|
||||
return 0
|
||||
return 1
|
||||
for(var/req in req_access)
|
||||
if(req in I.access) //has an access from the single access list
|
||||
return 1
|
||||
if(req_combined_access && req_combined_access.len)
|
||||
for(var/req in req_combined_access)
|
||||
if(!req in I.access)
|
||||
return 0
|
||||
return 1
|
||||
return 0
|
||||
|
||||
|
||||
/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(!L) return 0
|
||||
if(!istype(L, /list)) 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
|
||||
for(var/req in src.req_access)
|
||||
if(!(req in L)) //doesn't have this access - Leave like this DMTG
|
||||
return 0
|
||||
return 1
|
||||
if(!req_access)
|
||||
return 1
|
||||
if(!istype(req_access, /list))
|
||||
return 1
|
||||
if(!req_access.len)
|
||||
if(!req_combined_access || !islist(req_combined_access) || !req_combined_access.len)
|
||||
return 1
|
||||
if(!L)
|
||||
return 0
|
||||
if(!istype(L, /list))
|
||||
return 0
|
||||
for(var/req in req_access)
|
||||
if(req in L) //has an access from the single access list
|
||||
return 1
|
||||
if(req_combined_access && req_combined_access.len)
|
||||
for(var/req in req_combined_access)
|
||||
if(!req in L)
|
||||
return 0
|
||||
return 1
|
||||
return 0
|
||||
|
||||
|
||||
/proc/get_access(job)
|
||||
|
||||
@@ -2267,8 +2267,7 @@ var/global/BSACooldown = 0
|
||||
if("maint_access_engiebrig")
|
||||
for(var/obj/machinery/door/airlock/maintenance/M in world)
|
||||
if (access_maint_tunnels in M.req_access)
|
||||
M.req_access = list()
|
||||
M.req_one_access = list(access_brig,access_engine)
|
||||
M.req_access = list(access_brig,access_engine)
|
||||
message_admins("[key_name_admin(usr)] made all maint doors engineering and brig access-only.")
|
||||
if("infinite_sec")
|
||||
var/datum/job/J = job_master.GetJob("Security Officer")
|
||||
|
||||
Reference in New Issue
Block a user