From 9dc884207fcacb364afafb4f3f3d3d345dee513d Mon Sep 17 00:00:00 2001
From: GDN <96800819+GDNgit@users.noreply.github.com>
Date: Mon, 30 Oct 2023 14:10:59 -0500
Subject: [PATCH] fixes mail not working sometimes (#23024)
---
code/game/objects/mail.dm | 11 ++++++-----
1 file changed, 6 insertions(+), 5 deletions(-)
diff --git a/code/game/objects/mail.dm b/code/game/objects/mail.dm
index 10937972e55..bf6e788c7e7 100644
--- a/code/game/objects/mail.dm
+++ b/code/game/objects/mail.dm
@@ -13,7 +13,8 @@
var/list/possible_contents = list()
/// A list that contains the names of the jobs that can receive this type of letter. Only the base job has to be put in it, alternative titles have the same definition on the mind. Name of the job can be found in `mind.assigned_role`
var/list/job_list = list()
- var/mob/living/recipient
+ /// The real name required to open the letter
+ var/recipient
var/has_been_scanned = FALSE
/obj/item/envelope/suicide_act(mob/user)
@@ -24,7 +25,7 @@
/obj/item/envelope/attack_self(mob/user)
if(!user?.mind)
return
- if(user.real_name != recipient.real_name)
+ if(user.real_name != recipient)
to_chat(user, "You don't want to open up another person's mail, that's an invasion of their privacy!")
return
if(do_after(user, 1 SECONDS, target = user) && !QDELETED(src))
@@ -46,8 +47,8 @@
if(mail_attracted_people.offstation_role || !ishuman(mail_attracted_people.current) || is_admin_level(T.z))
continue
if(mail_attracted_people.assigned_role in job_list)
- recipient = mail_attracted_people.current
- name = "letter to [recipient.real_name]"
+ recipient = mail_attracted_people.current.real_name
+ name = "letter to [recipient]"
return
if(!admin_spawned)
log_debug("Failed to find a new name to assign to [src]!")
@@ -265,7 +266,7 @@
playsound(loc, 'sound/mail/maildenied.ogg', 50, TRUE)
return
- if(M.real_name != saved.recipient.real_name)
+ if(M.real_name != saved.recipient)
to_chat(user, "'Identity Verification failed: Target is not an authorized recipient of this package!")
playsound(loc, 'sound/mail/maildenied.ogg', 50, TRUE)
return