Fixes Newscaster Treatment of Wallets (#27121)

* move GetNameAndAssignmentFromId to cards_ids file

* simplyfiy and fix newscaster's get_scanned_user

Use human/get_id_card proc instead of custom solution.

* rename M to human_user

* Update code/modules/newscaster/obj/newscaster.dm

Co-authored-by: Henri215 <77684085+Henri215@users.noreply.github.com>
Signed-off-by:  Sean <12197162+S34NW@users.noreply.github.com>

---------

Signed-off-by: Sean <12197162+S34NW@users.noreply.github.com>
Co-authored-by: Sean <12197162+S34NW@users.noreply.github.com>
Co-authored-by: Henri215 <77684085+Henri215@users.noreply.github.com>
This commit is contained in:
Kenionatus
2024-10-22 09:47:12 +00:00
committed by GitHub
co-authored by Henri215 Sean
parent a8d322939c
commit b4d1bd1411
3 changed files with 7 additions and 16 deletions
+3 -12
View File
@@ -645,18 +645,9 @@ GLOBAL_LIST_EMPTY(allNewscasters)
/obj/machinery/newscaster/proc/get_scanned_user(mob/user)
. = list(name = "Unknown", security = user.can_admin_interact())
if(ishuman(user))
var/mob/living/carbon/human/M = user
// No ID, no luck
if(!M.wear_id)
return
// Try to get the ID
var/obj/item/card/id/ID
if(istype(M.wear_id, /obj/item/pda))
var/obj/item/pda/P = M.wear_id
ID = P.id
else if(istype(M.wear_id, /obj/item/card/id))
ID = M.wear_id
if(istype(ID))
var/mob/living/carbon/human/human_user = user
var/obj/item/card/id/ID = human_user.get_id_card()
if(ID)
return list(name = "[ID.registered_name] ([ID.assignment])", security = has_access(list(), list(ACCESS_SECURITY), ID.access))
else if(issilicon(user))
var/mob/living/silicon/ai_user = user