From 3b1b7747c6175383ed50dabac3470f40ff228e95 Mon Sep 17 00:00:00 2001 From: VerySoft Date: Wed, 20 Apr 2022 01:31:42 -0400 Subject: [PATCH 1/2] first step --- code/modules/resleeving/autoresleever.dm | 26 +++++++++++++++--------- 1 file changed, 16 insertions(+), 10 deletions(-) diff --git a/code/modules/resleeving/autoresleever.dm b/code/modules/resleeving/autoresleever.dm index 3b71aae2a8..ef308e95e9 100644 --- a/code/modules/resleeving/autoresleever.dm +++ b/code/modules/resleeving/autoresleever.dm @@ -63,16 +63,20 @@ return if(!istype(ghost,/mob/observer/dead)) return - - if(ghost.mind && ghost.mind.current && ghost.mind.current.stat != DEAD) - if(istype(ghost.mind.current.loc, /obj/item/device/mmi)) - if(tgui_alert(ghost, "Your brain is still alive, using the auto-resleever will delete that brain. Are you sure?", "Delete Brain", list("No","Yes")) != "Yes") - return + var/restored_memory = null + if(ghost.mind) + message_admins("I found a ghost mind!!!") + restored_memory = ghost.mind.memory + message_admins("I set restored memory to : [restored_memory]") + if(ghost.mind.current && ghost.mind.current.stat != DEAD) if(istype(ghost.mind.current.loc, /obj/item/device/mmi)) - qdel(ghost.mind.current.loc) - else - to_chat(ghost, "Your body is still alive, you cannot be resleeved.") - return + if(tgui_alert(ghost, "Your brain is still alive, using the auto-resleever will delete that brain. Are you sure?", "Delete Brain", list("No","Yes")) != "Yes") + return + if(istype(ghost.mind.current.loc, /obj/item/device/mmi)) + qdel(ghost.mind.current.loc) + else + to_chat(ghost, "Your body is still alive, you cannot be resleeved.") + return var/client/ghost_client = ghost.client @@ -156,7 +160,6 @@ if(new_character.mind) new_character.mind.loaded_from_ckey = picked_ckey new_character.mind.loaded_from_slot = picked_slot - var/datum/antagonist/antag_data = get_antag_data(new_character.mind.special_role) if(antag_data) antag_data.add_antagonist(new_character.mind) @@ -205,6 +208,9 @@ for(var/path in record.nif_software) new path(nif) nif.durability = record.nif_durability + if(restored_memory) + new_character.memory = restored_memory + message_admins("I tried to set [new_character]'s memory to [new_character.memory]") if(spawn_slots == -1) return From 68e391151429dd1d6c2a982236d9788acae99c50 Mon Sep 17 00:00:00 2001 From: VerySoft Date: Wed, 20 Apr 2022 04:16:41 -0400 Subject: [PATCH 2/2] Move da mind --- code/modules/resleeving/autoresleever.dm | 28 ++++++++++-------------- 1 file changed, 11 insertions(+), 17 deletions(-) diff --git a/code/modules/resleeving/autoresleever.dm b/code/modules/resleeving/autoresleever.dm index ef308e95e9..0b8433e90c 100644 --- a/code/modules/resleeving/autoresleever.dm +++ b/code/modules/resleeving/autoresleever.dm @@ -63,20 +63,15 @@ return if(!istype(ghost,/mob/observer/dead)) return - var/restored_memory = null - if(ghost.mind) - message_admins("I found a ghost mind!!!") - restored_memory = ghost.mind.memory - message_admins("I set restored memory to : [restored_memory]") - if(ghost.mind.current && ghost.mind.current.stat != DEAD) - if(istype(ghost.mind.current.loc, /obj/item/device/mmi)) - if(tgui_alert(ghost, "Your brain is still alive, using the auto-resleever will delete that brain. Are you sure?", "Delete Brain", list("No","Yes")) != "Yes") - return - if(istype(ghost.mind.current.loc, /obj/item/device/mmi)) - qdel(ghost.mind.current.loc) - else - to_chat(ghost, "Your body is still alive, you cannot be resleeved.") + if(ghost.mind && ghost.mind.current && ghost.mind.current.stat != DEAD) + if(istype(ghost.mind.current.loc, /obj/item/device/mmi)) + if(tgui_alert(ghost, "Your brain is still alive, using the auto-resleever will delete that brain. Are you sure?", "Delete Brain", list("No","Yes")) != "Yes") return + if(istype(ghost.mind.current.loc, /obj/item/device/mmi)) + qdel(ghost.mind.current.loc) + else + to_chat(ghost, "Your body is still alive, you cannot be resleeved.") + return var/client/ghost_client = ghost.client @@ -153,7 +148,9 @@ if(new_character.dna) new_character.dna.ResetUIFrom(new_character) new_character.sync_organ_dna() - + if(ghost.mind) + ghost.mind.transfer_to(new_character) + new_character.key = player_key //Were they any particular special role? If so, copy. @@ -208,9 +205,6 @@ for(var/path in record.nif_software) new path(nif) nif.durability = record.nif_durability - if(restored_memory) - new_character.memory = restored_memory - message_admins("I tried to set [new_character]'s memory to [new_character.memory]") if(spawn_slots == -1) return