Fix wallets appearing to still contain a removed ID (#37719)

This commit is contained in:
Tad Hardesty
2018-05-09 08:30:29 -07:00
committed by vuonojenmustaturska
parent 69cdd4f269
commit b235fceca6

View File

@@ -38,16 +38,20 @@
/obj/item/storage/wallet/Exited(atom/movable/AM)
. = ..()
refreshID()
// The loc has not actually changed yet when this proc is called, so call
// refreshID and have it ignore the outgoing atom.
refreshID(AM)
/obj/item/storage/wallet/proc/refreshID()
if(!(front_id in src))
/obj/item/storage/wallet/proc/refreshID(atom/movable/removed)
LAZYCLEARLIST(combined_access)
if(!(front_id in src) || front_id == removed)
front_id = null
for(var/obj/item/card/id/I in contents)
LAZYINITLIST(combined_access)
LAZYCLEARLIST(combined_access)
if(I == removed)
continue
if(!front_id)
front_id = I
LAZYINITLIST(combined_access)
combined_access |= I.access
update_icon()