From 14f01b6a830f3b9efb0fba0b9ee2b20a8c25f2f1 Mon Sep 17 00:00:00 2001 From: AndroidSFV Date: Mon, 13 May 2013 18:46:33 -0500 Subject: [PATCH] Changes the way telecomms identifies the job of the sender of a radio message. It now references the crew manifest with the name of the sender for their job, instead of looking at whatever ID they are holding for their job. --- .../game/objects/items/devices/radio/radio.dm | 27 +++++++++++-------- 1 file changed, 16 insertions(+), 11 deletions(-) diff --git a/code/game/objects/items/devices/radio/radio.dm b/code/game/objects/items/devices/radio/radio.dm index 8d08999cb9b..330e6f47c7d 100644 --- a/code/game/objects/items/devices/radio/radio.dm +++ b/code/game/objects/items/devices/radio/radio.dm @@ -246,9 +246,23 @@ var/GLOBAL_RADIO_TYPE = 1 // radio type to use var/jobname // the mob's "job" - // --- Human: use their actual job --- + + // --- Human: use their job as seen on the crew manifest - makes it unneeded to carry an ID for an AI to see their job if (ishuman(M)) - jobname = M:get_assignment() + var/voice = M.GetVoice() // Why reinvent the wheel when there is a proc that does nice things already + var/datum/data/record/findjob + for (var/datum/data/record/t in data_core.general) + if(t.fields["name"] == voice) + findjob = t + break + + if(voice != real_name) + displayname = voice + voicemask = 1 + if(findjob) + jobname = findjob.fields["rank"] + else + jobname = "Unknown" // --- Carbon Nonhuman --- else if (iscarbon(M)) // Nonhuman carbon mob @@ -271,15 +285,6 @@ var/GLOBAL_RADIO_TYPE = 1 // radio type to use jobname = "Unknown" - // --- Modifications to the mob's identity --- - - // The mob is disguising their identity: - if (ishuman(M) && M.GetVoice() != real_name) - displayname = M.GetVoice() - jobname = "Unknown" - voicemask = 1 - - /* ###### Radio headsets can only broadcast through subspace ###### */