Skip to content

Commit

Permalink
Fix being able to re-scan the body of someone already cloned (goonsta…
Browse files Browse the repository at this point in the history
  • Loading branch information
TealSeer committed Sep 27, 2024
1 parent 3452cae commit 0729c1a
Showing 1 changed file with 13 additions and 5 deletions.
18 changes: 13 additions & 5 deletions code/obj/machinery/computer/cloning.dm
Original file line number Diff line number Diff line change
Expand Up @@ -270,8 +270,14 @@ ADMIN_INTERACT_PROCS(/obj/machinery/computer/cloning, proc/scan_someone, proc/cl

var/datum/mind/subjMind = subject.mind
if ((!subjMind) || (!subjMind.key))
if (eligible_to_clone(subject.oldmind))
subjMind = subject.oldmind
if(subject.ghost?.mind)
subjMind = subject.ghost.mind
else if(subject.oldmind)
if(eligible_to_clone(subject.oldmind, scanning = TRUE))
subjMind = subject.oldmind
else
show_message("Error: Mental interface failure.", "warning")
return
else
show_message("Error: Mental interface failure.", "warning")
return
Expand Down Expand Up @@ -434,8 +440,10 @@ ADMIN_INTERACT_PROCS(/obj/machinery/computer/cloning, proc/scan_someone, proc/cl
src.menu = 1
src.records_scan()

// check if a mind has a current mob, a client, and is dead/a ghost/doing afterlife stuff
proc/eligible_to_clone(var/datum/mind/mind)
/// Check if a mind has a current mob, a client, and is dead/a ghost/doing afterlife stuff.
/// Scanning var controls whether we will return ghosts, because ghosts needs special handling in clone scans
/// to ensure they're not using a body that they've been cloned from before
proc/eligible_to_clone(datum/mind/mind, scanning = FALSE)
if (!mind)
return null

Expand All @@ -456,7 +464,7 @@ proc/eligible_to_clone(var/datum/mind/mind)
return null
if(iswraith(M))
return null
if(isdead(M) || isVRghost(M) || inafterlifebar(M) || isghostcritter(M))
if((!scanning && isdead(M)) || isVRghost(M) || inafterlifebar(M) || isghostcritter(M))
return M
return null

Expand Down

0 comments on commit 0729c1a

Please sign in to comment.