From 2f90aa395916ac550e5af33ae1806b3e1eaa9516 Mon Sep 17 00:00:00 2001 From: "aranclanos@hotmail.com" Date: Mon, 7 Jan 2013 19:36:59 +0000 Subject: [PATCH] Runtime fixes for using sechuds to examine people with wallets and null PDAs. If the selected mob is wearing a PDA, it will pick the PDA owner instead of the ID inside of the PDA. git-svn-id: http://tgstation13.googlecode.com/svn/trunk@5488 316c924e-a436-60f5-8080-3fe189b3f50e --- .../mob/living/carbon/human/examine.dm | 26 ++++++++++++------- 1 file changed, 17 insertions(+), 9 deletions(-) diff --git a/code/modules/mob/living/carbon/human/examine.dm b/code/modules/mob/living/carbon/human/examine.dm index 33e2b5185b6..f0ca3e9dfe9 100644 --- a/code/modules/mob/living/carbon/human/examine.dm +++ b/code/modules/mob/living/carbon/human/examine.dm @@ -270,20 +270,28 @@ var/criminal = "None" if(wear_id) - var/obj/item/weapon/card/id/I = wear_id.GetID() - perpname = I.registered_name + if (istype(wear_id, /obj/item/weapon/card/id)) + var/obj/item/weapon/card/id/I = wear_id + perpname = I.registered_name + else if (istype(wear_id, /obj/item/device/pda)) + var/obj/item/device/pda/P = wear_id + perpname = P.owner + else if (istype(wear_id, /obj/item/weapon/storage/wallet)) + var/obj/item/weapon/storage/wallet/W = wear_id + perpname = W.front_id else perpname = name - for (var/datum/data/record/E in data_core.general) - if(E.fields["name"] == perpname) - for (var/datum/data/record/R in data_core.security) - if(R.fields["id"] == E.fields["id"]) - criminal = R.fields["criminal"] + if(perpname) + for (var/datum/data/record/E in data_core.general) + if(E.fields["name"] == perpname) + for (var/datum/data/record/R in data_core.security) + if(R.fields["id"] == E.fields["id"]) + criminal = R.fields["criminal"] - msg += "Criminal status: \[[criminal]\]\n" - //msg += "\[Set Hostile Identification\]\n" + msg += "Criminal status: \[[criminal]\]\n" + //msg += "\[Set Hostile Identification\]\n" msg += "*---------*"