mirror of
https://github.com/PolarisSS13/Polaris.git
synced 2026-08-21 04:06:55 +01:00
Merge pull request #8122 from VOREStation/Arokha/access
Make req_[one_]access lazy
This commit is contained in:
@@ -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>")
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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>")
|
||||
|
||||
Reference in New Issue
Block a user