From 0fa1251056a0247da79ace1f7693246e3944a3f5 Mon Sep 17 00:00:00 2001 From: Lucy Date: Sun, 6 Oct 2024 07:11:20 -0400 Subject: [PATCH] Attempt at fixing the modular persistence runtimes (#3701) --- code/datums/mind/_mind.dm | 3 ++- .../code/modules/cryopods/persistance/base_persistance.dm | 4 ++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/code/datums/mind/_mind.dm b/code/datums/mind/_mind.dm index 195f5305fe18..9a78ba24b233 100644 --- a/code/datums/mind/_mind.dm +++ b/code/datums/mind/_mind.dm @@ -519,7 +519,8 @@ return martial_art return FALSE -/datum/mind/proc/get_ghost(even_if_they_cant_reenter, ghosts_with_clients) +/datum/mind/proc/get_ghost(even_if_they_cant_reenter, ghosts_with_clients) as /mob/dead/observer + RETURN_TYPE(/mob/dead/observer) for(var/mob/dead/observer/G in (ghosts_with_clients ? GLOB.player_list : GLOB.dead_mob_list)) if(G.mind == src) if(G.can_reenter_corpse || even_if_they_cant_reenter) diff --git a/monkestation/code/modules/cryopods/persistance/base_persistance.dm b/monkestation/code/modules/cryopods/persistance/base_persistance.dm index 46d5c5ae18a4..66e0038416b7 100644 --- a/monkestation/code/modules/cryopods/persistance/base_persistance.dm +++ b/monkestation/code/modules/cryopods/persistance/base_persistance.dm @@ -113,7 +113,7 @@ GLOBAL_LIST_INIT(modular_persistence_ignored_vars, list( WRITE_FILE(json_file, json_encode(json)) /// Saves the persistence data for the owner. -/mob/living/carbon/human/proc/save_individual_persistence(var/ckey) +/mob/living/carbon/human/proc/save_individual_persistence(ckey) var/obj/item/organ/internal/brain/brain = get_organ_slot(ORGAN_SLOT_BRAIN) - return brain?.modular_persistence?.save_data(ckey) + return brain?.modular_persistence?.save_data(ckey || src.ckey || brain?.brainmob?.ckey || ckey(mind?.key) || mind?.get_ghost(TRUE)?.ckey)