From 9c2224e6d8724336f39b39f73e32b91e68569d86 Mon Sep 17 00:00:00 2001 From: Albert Iordache Date: Wed, 4 Jan 2012 14:29:16 +0200 Subject: [PATCH] Fixed a case where the player panel wouldn't open This shouldn't even happen :O --- code/modules/admin/admin.dm | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/code/modules/admin/admin.dm b/code/modules/admin/admin.dm index ee893da1bd..d0a70b6122 100644 --- a/code/modules/admin/admin.dm +++ b/code/modules/admin/admin.dm @@ -1888,16 +1888,20 @@ if (H.wear_id) var/obj/item/weapon/card/id/id - if(istype(H.wear_id, /obj/item/weapon/card/id)) - id = H.wear_id // The ID is on the ID slot - else if(istype(H.wear_id, /obj/item/device/pda)) + if(istype(H.wear_id, /obj/item/device/pda)) var/obj/item/device/pda/PDA = H.wear_id - id = PDA.id // The ID is contained inside the PDA - - if(M.mind.assigned_role == id.assignment) // Polymorph - dat += "[M.mind.assigned_role]" + id = PDA.id // The ID is contained inside the PDA else - dat += "[M.mind.assigned_role] ([id.assignment])" + id = H.wear_id + + if(isnull(id.assignment)) + usr << "ERROR: Inform the coders that an [id.name] was checked for its assignment variable." + dat += "ERROR" + else + if(M.mind.assigned_role == id.assignment) // Polymorph + dat += "[M.mind.assigned_role]" + else + dat += "[M.mind.assigned_role] ([id.assignment])" else dat += "[M.mind.assigned_role] (No ID)"