From b7c13761ef50474a278d0d545946d31b1bfb96c6 Mon Sep 17 00:00:00 2001 From: supersayu Date: Wed, 17 Jul 2013 15:51:19 -0400 Subject: [PATCH] Fixes a rare potential runtime for using the admin grant_full_access verb on a mob with something other than an ID in the ID slot. --- code/modules/admin/verbs/debug.dm | 29 +++++++++++++++++++++++++++-- 1 file changed, 27 insertions(+), 2 deletions(-) diff --git a/code/modules/admin/verbs/debug.dm b/code/modules/admin/verbs/debug.dm index f3319758eff..5b93250e1c9 100644 --- a/code/modules/admin/verbs/debug.dm +++ b/code/modules/admin/verbs/debug.dm @@ -445,8 +445,33 @@ var/global/list/g_fancy_list_of_safe_types = null if(istype(H.wear_id, /obj/item/device/pda)) var/obj/item/device/pda/pda = H.wear_id id = pda.id - id.icon_state = "gold" - id:access = get_all_accesses()+get_all_centcom_access()+get_all_syndicate_access() + if(!id) + pda.id = new /obj/item/weapon/card/id(pda) + pda.id.icon_state = "gold" + pda.id.access = get_all_accesses()+get_all_centcom_access()+get_all_syndicate_access() + pda.id.registered_name = H.real_name + pda.id.assignment = "Captain" + pda.id.name = "[pda.id.registered_name]'s ID Card ([pda.id.assignment])" + else + id.icon_state = "gold" + id:access = get_all_accesses()+get_all_centcom_access()+get_all_syndicate_access() + else if(istype(H.wear_id,/obj/item/weapon/storage/wallet)) + var/obj/item/weapon/storage/wallet/W = H.wear_id + id = W.front_id + if(!id) + id = new /obj/item/weapon/card/id(W) + id.icon_state = "gold" + id.access = get_all_accesses()+get_all_centcom_access()+get_all_syndicate_access() + id.registered_name = H.real_name + id.assignment = "Captain" + id.name = "[id.registered_name]'s ID Card ([id.assignment])" + W.front_id = id + else + id.icon_state = "gold" + id:access = get_all_accesses()+get_all_centcom_access()+get_all_syndicate_access() + else + id.icon_state = "gold" + id:access = get_all_accesses()+get_all_centcom_access()+get_all_syndicate_access() else var/obj/item/weapon/card/id/id = new/obj/item/weapon/card/id(M); id.icon_state = "gold"