From 4b38a438dec37e20a05bf9c79a9dc3753dcd8030 Mon Sep 17 00:00:00 2001 From: coiax Date: Mon, 13 Mar 2017 09:05:28 +0000 Subject: [PATCH] Additional deadchat fixes (#25012) * Additional deadchat fixes Fixes #25008. - People who are dead but not observers can hear deadchat. - Follow links will try to follow first, then attempt a turf jump, rather than always doing the turf jump. - By using coordinates rather than /ref it'll stop the malformed (F) links to jump to the turfs. * text2num is my friend --- code/__DEFINES/say.dm | 4 ++-- code/__HELPERS/mobs.dm | 2 ++ code/modules/mob/dead/observer/observer.dm | 10 ++++++++-- 3 files changed, 12 insertions(+), 4 deletions(-) diff --git a/code/__DEFINES/say.dm b/code/__DEFINES/say.dm index 08f873067bd..2d460f2d8b4 100644 --- a/code/__DEFINES/say.dm +++ b/code/__DEFINES/say.dm @@ -34,5 +34,5 @@ // A link given to ghost alice to follow bob #define FOLLOW_LINK(alice, bob) "(F)" -#define TURF_LINK(alice, turfy) "(T)" -#define FOLLOW_OR_TURF_LINK(alice, bob, turfy) "(F)" +#define TURF_LINK(alice, turfy) "(T)" +#define FOLLOW_OR_TURF_LINK(alice, bob, turfy) "(F)" diff --git a/code/__HELPERS/mobs.dm b/code/__HELPERS/mobs.dm index c41fe367b0d..f123898f9e1 100644 --- a/code/__HELPERS/mobs.dm +++ b/code/__HELPERS/mobs.dm @@ -408,3 +408,5 @@ Proc for attack log creation, because really why not var/turf_link = TURF_LINK(M, turf_target) rendered_message = "[turf_link] [message]" to_chat(M, rendered_message) + else + to_chat(M, message) diff --git a/code/modules/mob/dead/observer/observer.dm b/code/modules/mob/dead/observer/observer.dm index 3cefc25646a..93710f783f5 100644 --- a/code/modules/mob/dead/observer/observer.dm +++ b/code/modules/mob/dead/observer/observer.dm @@ -671,12 +671,18 @@ This is the proc mobs get to turn into a ghost. Forked from ghostize due to comp var/atom/movable/target = locate(href_list["follow"]) if(istype(target) && (target != src)) ManualFollow(target) - if(href_list["jump_to_turf"]) - var/turf/target = locate(href_list["jump_to_turf"]) + return + if(href_list["x"] && href_list["y"] && href_list["z"]) + var/tx = text2num(href_list["x"]) + var/ty = text2num(href_list["y"]) + var/tz = text2num(href_list["z"]) + var/turf/target = locate(tx, ty, tz) if(istype(target)) forceMove(target) + return if(href_list["reenter"]) reenter_corpse() + return //We don't want to update the current var //But we will still carry a mind.