From bdd4e70673d29f4ccbe5c02603f824c7d4e56114 Mon Sep 17 00:00:00 2001 From: tralezab <40974010+tralezab@users.noreply.github.com> Date: Mon, 26 Apr 2021 15:50:35 -0700 Subject: [PATCH] mail fixes :sunglasses: (#58716) now mail doesn't get sent to... BAD recipients. (Antags arm, just say antags) fixes incorrect unwrapping message (bad usage of a visible message) mail recipients wasn't shuffling either. I'm fairly certain this was leading to some people always getting mail and some never getting it. --- code/game/objects/items/mail.dm | 2 +- code/modules/shuttle/supply.dm | 9 ++++++--- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/code/game/objects/items/mail.dm b/code/game/objects/items/mail.dm index 25740e2c50c..d3ab5eeeeed 100644 --- a/code/game/objects/items/mail.dm +++ b/code/game/objects/items/mail.dm @@ -113,7 +113,7 @@ to_chat(user, "You can't open somebody else's mail! That's illegal!") return - user.visible_message("You start to unwrap the package...") + to_chat(user, "You start to unwrap the package...") if(!do_after(user, 1.5 SECONDS, target = user)) return user.temporarilyRemoveItemFromInventory(src, TRUE) diff --git a/code/modules/shuttle/supply.dm b/code/modules/shuttle/supply.dm index 8e2cd8b9b27..4b8cf5aaf67 100644 --- a/code/modules/shuttle/supply.dm +++ b/code/modules/shuttle/supply.dm @@ -257,9 +257,12 @@ GLOBAL_LIST_INIT(blacklisted_cargo_types, typecacheof(list( //collect recipients var/list/mail_recipients = list() - for(var/mob/living/carbon/human/player_human in GLOB.player_list) - if(player_human.stat != DEAD) - mail_recipients += player_human + for(var/mob/living/carbon/human/player_human in shuffle(GLOB.player_list)) + if(player_human.stat == DEAD) + continue + if(!SSjob.GetJob(player_human.mind.assigned_role) || (player_human.mind.assigned_role in GLOB.nonhuman_positions)) + continue //this check stops wizards and nuke ops from getting mail, which is hilarious but should definitely not happen + mail_recipients += player_human //Creates mail for all the mail waiting to arrive, if there's nobody to recieve it it's just junkmail. for(var/mail_iterator in 1 to SSeconomy.mail_waiting)