Skip to content

Commit

Permalink
better logging on who killed someone.
Browse files Browse the repository at this point in the history
  • Loading branch information
realforest2001 committed Jul 31, 2023
1 parent 7c674ed commit 7801f5f
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions code/datums/statistics/entities/death_stats.dm
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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

Expand Down

0 comments on commit 7801f5f

Please sign in to comment.