mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2026-07-12 08:36:00 +01:00
Merge pull request #13440 from octareenroon91/patch-32
Give wallets merged access of all IDs inside.
This commit is contained in:
@@ -30,21 +30,31 @@
|
||||
slot_flags = SLOT_ID
|
||||
|
||||
var/obj/item/weapon/card/id/front_id = null
|
||||
var/list/combined_access = list()
|
||||
|
||||
|
||||
/obj/item/weapon/storage/wallet/remove_from_storage(obj/item/W, atom/new_location)
|
||||
. = ..(W, new_location)
|
||||
if(.)
|
||||
if(W == front_id)
|
||||
front_id = null
|
||||
if(istype(W, /obj/item/weapon/card/id))
|
||||
if(W == front_id)
|
||||
front_id = null
|
||||
refreshID()
|
||||
update_icon()
|
||||
|
||||
/obj/item/weapon/storage/wallet/proc/refreshID()
|
||||
combined_access.Cut()
|
||||
for(var/obj/item/weapon/card/id/I in contents)
|
||||
if(!front_id)
|
||||
front_id = I
|
||||
update_icon()
|
||||
combined_access |= I.access
|
||||
|
||||
/obj/item/weapon/storage/wallet/handle_item_insertion(obj/item/W, prevent_warning = 0)
|
||||
. = ..(W, prevent_warning)
|
||||
if(.)
|
||||
if(!front_id && istype(W, /obj/item/weapon/card/id))
|
||||
front_id = W
|
||||
update_icon()
|
||||
if(istype(W, /obj/item/weapon/card/id))
|
||||
refreshID()
|
||||
|
||||
/obj/item/weapon/storage/wallet/update_icon()
|
||||
|
||||
@@ -69,9 +79,8 @@
|
||||
return front_id
|
||||
|
||||
/obj/item/weapon/storage/wallet/GetAccess()
|
||||
var/obj/item/I = GetID()
|
||||
if(I)
|
||||
return I.GetAccess()
|
||||
if(combined_access.len)
|
||||
return combined_access
|
||||
else
|
||||
return ..()
|
||||
|
||||
@@ -89,4 +98,4 @@
|
||||
if(item2_type)
|
||||
new item2_type(src)
|
||||
if(item3_type)
|
||||
new item3_type(src)
|
||||
new item3_type(src)
|
||||
|
||||
Reference in New Issue
Block a user