Merge pull request #8122 from VOREStation/Arokha/access

Make req_[one_]access lazy
This commit is contained in:
Atermonera
2021-06-14 00:22:04 -07:00
committed by GitHub
12 changed files with 56 additions and 62 deletions
+1 -1
View File
@@ -119,7 +119,7 @@
item_state = icon_state
wires = new(src)
if((!req_access || !req_access.len) && (!req_one_access || !req_one_access.len))
if(!LAZYLEN(req_access) && !LAZYLEN(req_one_access))
locked = 0
spark_system = new()
@@ -17,7 +17,7 @@
to_chat(user, "<span class='danger'>It looks like the locking system has been shorted out.</span>")
return
if((!req_access || !req_access.len) && (!req_one_access || !req_one_access.len))
if(!LAZYLEN(req_access) && !LAZYLEN(req_one_access))
locked = 0
to_chat(user, "<span class='danger'>\The [src] doesn't seem to have a locking mechanism.</span>")
return
@@ -190,8 +190,8 @@
/obj/item/weapon/rig/emag_act(var/remaining_charges, var/mob/user)
if(!subverted)
req_access.Cut()
req_one_access.Cut()
LAZYCLEARLIST(req_access)
LAZYCLEARLIST(req_one_access)
locked = 0
subverted = 1
to_chat(user, "<span class='danger'>You short out the access protocol for the suit.</span>")
+1 -1
View File
@@ -190,7 +190,7 @@
// Check for required access.
var/obj/item/weapon/card/id/current_id = M.wear_id
if(citem.req_access && citem.req_access > 0)
if(citem.req_access && citem.req_access > 0) // These are numbers, not lists
if(!(istype(current_id) && (citem.req_access in current_id.access)))
log_debug("Custom Item: [key_name(M)] Does not have required access.")
continue
+1 -1
View File
@@ -523,7 +523,7 @@
if(lockdown)
to_chat(user, "<span class='notice'>\The [src]'s control panel thunks, as its cover retracts.</span>")
lockdown = 0
if(req_access || req_one_access)
if(LAZYLEN(req_access) || LAZYLEN(req_one_access))
req_access = list()
req_one_access = list()
to_chat(user, "<span class='warning'>\The [src]'s access mechanism shorts out.</span>")