Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixes Observer Death Messages being delayed #4775

Merged
merged 1 commit into from
Oct 24, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 5 additions & 6 deletions code/datums/statistics/entities/death_stats.dm
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,10 @@
if(!mind || statistic_exempt)
return

var/area/area = get_area(death_loc)
handle_observer_message(cause_data, cause_mob, death_loc, area)

// Perform logging above before get_player_from_key to avoid delays
var/datum/entity/statistic/death/new_death = DB_ENTITY(/datum/entity/statistic/death)
var/datum/entity/player/player_entity = get_player_from_key(mind.ckey)
if(player_entity)
Expand All @@ -95,11 +99,8 @@
new_death.role_name = get_role_name()
new_death.mob_name = real_name
new_death.faction_name = faction

new_death.is_xeno = FALSE

var/area/A = get_area(death_loc)
new_death.area_name = A.name
new_death.area_name = area.name

new_death.cause_name = cause_data?.cause_name
var/datum/entity/player/cause_player = get_player_from_key(cause_data?.ckey)
Expand Down Expand Up @@ -132,8 +133,6 @@
new_death.total_damage_taken = life_damage_taken_total
new_death.total_revives_done = life_revives_total

handle_observer_message(cause_data, cause_mob, death_loc, A)

if(round_statistics)
round_statistics.track_death(new_death)

Expand Down
Loading