From 00b547f2aa63d6e933fad02bb6675b9132787938 Mon Sep 17 00:00:00 2001 From: Drulikar Date: Sun, 9 Jun 2024 07:45:22 -0700 Subject: [PATCH 1/2] Fix tod not getting assigned if ghostized without a client --- code/modules/mob/dead/observer/observer.dm | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/code/modules/mob/dead/observer/observer.dm b/code/modules/mob/dead/observer/observer.dm index e974a93553a3..df12929dc476 100644 --- a/code/modules/mob/dead/observer/observer.dm +++ b/code/modules/mob/dead/observer/observer.dm @@ -471,6 +471,12 @@ Works together with spawning an observer, noted above. mind = null + // Larva queue: We use the larger of their existing queue time or the new timeofdeath except for facehuggers or lesser drone + var/new_tod = (isfacehugger(src) || islesserdrone(src)) ? 1 : ghost.timeofdeath + + // if they died as facehugger or lesser drone, bypass typical TOD checks + ghost.bypass_time_of_death_checks = (isfacehugger(src) || islesserdrone(src)) + if(ghost.client) ghost.client.init_verbs() ghost.client.change_view(GLOB.world_view_size) //reset view range to default @@ -485,13 +491,12 @@ Works together with spawning an observer, noted above. if(ghost.client.player_data) ghost.client.player_data.load_timestat_data() - // Larva queue: We use the larger of their existing queue time or the new timeofdeath except for facehuggers or lesser drone - var/new_tod = (isfacehugger(src) || islesserdrone(src)) ? 1 : ghost.timeofdeath - - // if they died as facehugger or lesser drone, bypass typical TOD checks - ghost.bypass_time_of_death_checks = (isfacehugger(src) || islesserdrone(src)) + ghost.client.player_details.larva_queue_time = max(ghost.client.player_details.larva_queue_time, new_tod) - ghost.client?.player_details.larva_queue_time = max(ghost.client.player_details.larva_queue_time, new_tod) + else if(persistent_ckey) + var/datum/player_details/details = GLOB.player_details[persistent_ckey] + if(details) + details.larva_queue_time = max(ghost.client.player_details.larva_queue_time, new_tod) ghost.set_huds_from_prefs() From ee26a74db9b7473499d1d523d0ccae26ce1d186f Mon Sep 17 00:00:00 2001 From: Drulikar Date: Sun, 9 Jun 2024 08:00:43 -0700 Subject: [PATCH 2/2] Fix --- code/modules/mob/dead/observer/observer.dm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/code/modules/mob/dead/observer/observer.dm b/code/modules/mob/dead/observer/observer.dm index df12929dc476..732c60a71870 100644 --- a/code/modules/mob/dead/observer/observer.dm +++ b/code/modules/mob/dead/observer/observer.dm @@ -496,7 +496,7 @@ Works together with spawning an observer, noted above. else if(persistent_ckey) var/datum/player_details/details = GLOB.player_details[persistent_ckey] if(details) - details.larva_queue_time = max(ghost.client.player_details.larva_queue_time, new_tod) + details.larva_queue_time = max(details.larva_queue_time, new_tod) ghost.set_huds_from_prefs()