From 7801f5f39266551bb5a3ed3979afad3cc761531d Mon Sep 17 00:00:00 2001 From: forest2001 Date: Mon, 31 Jul 2023 12:59:02 +0100 Subject: [PATCH] better logging on who killed someone. --- code/datums/statistics/entities/death_stats.dm | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/code/datums/statistics/entities/death_stats.dm b/code/datums/statistics/entities/death_stats.dm index 5c65c8b390b1..4a01e4e9d72b 100644 --- a/code/datums/statistics/entities/death_stats.dm +++ b/code/datums/statistics/entities/death_stats.dm @@ -69,9 +69,16 @@ stack_trace("track_mob_death called with string cause ([cause_data]) instead of datum") cause_data = create_cause_data(cause_data) - var/log_message = "\[[time_stamp()]\] [key_name(src)] died" + var/log_message = "\[[time_stamp()]\] [key_name(src)] died to " if(cause_data) - log_message += " to [cause_data.cause_name]" + log_message += "[cause_data.cause_name]" + else + log_message += "unknown causes" + var/mob/cause_mob = cause_data?.resolve_mob() + if(cause_mob) + log_message += " from [key_name(cause_data.resolve_mob())]" + cause_mob.attack_log += "\[[time_stamp()]\] [key_name(cause_mob)] killed [key_name(src)] with [cause_data.cause_name]." + attack_log += "[log_message]." if(!mind || statistic_exempt) @@ -101,7 +108,6 @@ new_death.cause_role_name = cause_data?.role new_death.cause_faction_name = cause_data?.faction - var/mob/cause_mob = cause_data?.resolve_mob() if(cause_mob) cause_mob.life_kills_total += life_value