From 9a33b1077ce5cd60aa759c7cdd68a433ebdce266 Mon Sep 17 00:00:00 2001 From: Jamini Date: Fri, 22 May 2015 10:52:51 -0400 Subject: [PATCH] cleaned up some ID-related procs get_authentication_rank, get_assignment, and get_authentication_name cleaned up and standardized to use GetID(). All three now also display information based on what the PDA has when the PDA is visible, rather than the card inside. (Subject to change) BUGFIX - NEEDS TESTING - DO NOT MERGE --- code/modules/mob/living/carbon/human/human.dm | 53 +++++++------------ 1 file changed, 19 insertions(+), 34 deletions(-) diff --git a/code/modules/mob/living/carbon/human/human.dm b/code/modules/mob/living/carbon/human/human.dm index 3f643656..db6483d2 100644 --- a/code/modules/mob/living/carbon/human/human.dm +++ b/code/modules/mob/living/carbon/human/human.dm @@ -484,50 +484,35 @@ // Get rank from ID, ID inside PDA, PDA, ID in wallet, etc. /mob/living/carbon/human/proc/get_authentification_rank(var/if_no_id = "No id", var/if_no_job = "No job") - var/obj/item/device/pda/pda = wear_id - if (istype(pda)) - if (pda.id) - return pda.id.rank - else - return pda.ownrank + if(wear_id istype obj/item/device/pda) + return pda.ownrank + var/obj/item/weapon/card/id/id = GetID() + if(id) + return id.rank ? id.rank : if_no_job else - var/obj/item/weapon/card/id/id = get_idcard() - if(id) - return id.rank ? id.rank : if_no_job - else - return if_no_id + return if_no_id //gets assignment from ID or ID inside PDA or PDA itself //Useful when player do something with computers /mob/living/carbon/human/proc/get_assignment(var/if_no_id = "No id", var/if_no_job = "No job") - var/obj/item/device/pda/pda = wear_id - if (istype(pda)) - if (pda.id) - return pda.id.assignment - else - return pda.ownjob + if(wear_id istype obj/item/device/pda) + return pda.ownjob + var/obj/item/weapon/card/id/id = GetID() + if(id) + return id.assignment ? id.assignment : if_no_job else - var/obj/item/weapon/card/id/id = get_idcard() - if(id) - return id.assignment ? id.assignment : if_no_job - else - return if_no_id + return if_no_id //gets name from ID or ID inside PDA or PDA itself //Useful when player do something with computers /mob/living/carbon/human/proc/get_authentification_name(var/if_no_id = "Unknown") - var/obj/item/device/pda/pda = wear_id - if (istype(pda)) - if (pda.id) - return pda.id.registered_name - else - return pda.owner + if(wear_id istype obj/item/device/pda) + return pda.owner + var/obj/item/weapon/card/id/id = GetID() + if(id) + return id.registered_name else - var/obj/item/weapon/card/id/id = get_idcard() - if(id) - return id.registered_name - else - return if_no_id + return if_no_id //repurposed proc. Now it combines get_id_name() and get_face_name() to determine a mob's name variable. Made into a seperate proc as it'll be useful elsewhere /mob/living/carbon/human/proc/get_visible_name() @@ -1649,4 +1634,4 @@ var/datum/organ/internal/eyes = internal_organs_by_name["eyes"] if(eyes && istype(eyes) && !eyes.status & ORGAN_CUT_AWAY) return 1 - return 0 \ No newline at end of file + return 0