From d52f4c188197d9aa56998e019c6894272e8d37f2 Mon Sep 17 00:00:00 2001 From: joep van der velden Date: Wed, 27 Mar 2019 12:11:29 +0100 Subject: [PATCH 1/7] Cloners now only clone a person once max --- code/game/machinery/computer/cloning.dm | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/code/game/machinery/computer/cloning.dm b/code/game/machinery/computer/cloning.dm index c134747cd41..7b9f74edbd6 100644 --- a/code/game/machinery/computer/cloning.dm +++ b/code/game/machinery/computer/cloning.dm @@ -36,12 +36,25 @@ if(scanner.occupant && can_autoprocess()) scan_mob(scanner.occupant) - + + if(!length(records)) + return + var/list/toClone = records.Copy() + var/datum/dna2/record/lastEntry = toClone[length(toClone)] // Most recently added record + // Prevent double cloning + for(var/obj/machinery/clonepod/pod in pods) + if(pod.occupant) + for(var/datum/soullink/soulhook/hook in pod.sharedSoulhooks) //Check the soul hooks to see if the to be cloned person is in here + if(hook.soulowner.ckey == lastEntry.ckey) + toClone.Remove(lastEntry) // Fucker is getting cloned. No two bodies greedy shit + break + for(var/obj/machinery/clonepod/pod in pods) if(!(pod.occupant || pod.mess) && (pod.efficiency > 5)) - for(var/datum/dna2/record/R in src.records) + for(var/datum/dna2/record/R in toClone) if(!(pod.occupant || pod.mess)) if(pod.growclone(R)) + toClone.Remove(R) records.Remove(R) /obj/machinery/computer/cloning/proc/updatemodules() From 82096b5338621d657edfba8cd8d430b8a164b256 Mon Sep 17 00:00:00 2001 From: joep van der velden Date: Wed, 27 Mar 2019 12:23:12 +0100 Subject: [PATCH 2/7] also supports the directly put in body thing --- code/game/machinery/computer/cloning.dm | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/code/game/machinery/computer/cloning.dm b/code/game/machinery/computer/cloning.dm index 7b9f74edbd6..8c7599a3189 100644 --- a/code/game/machinery/computer/cloning.dm +++ b/code/game/machinery/computer/cloning.dm @@ -44,10 +44,14 @@ // Prevent double cloning for(var/obj/machinery/clonepod/pod in pods) if(pod.occupant) - for(var/datum/soullink/soulhook/hook in pod.sharedSoulhooks) //Check the soul hooks to see if the to be cloned person is in here - if(hook.soulowner.ckey == lastEntry.ckey) - toClone.Remove(lastEntry) // Fucker is getting cloned. No two bodies greedy shit - break + if(pod.occupant.ckey == null) // Uses soulhooks + for(var/datum/soullink/soulhook/hook in pod.sharedSoulhooks) //Check the soul hooks to see if the to be cloned person is in here + if(hook.soulowner.ckey == lastEntry.ckey) + toClone.Remove(lastEntry) // Guy is getting cloned so remove the entry + break + else if(pod.occupant.ckey == lastEntry.ckey) // Directly put in body + toClone.Remove(lastEntry) // Guy is getting cloned so remove the entry + break for(var/obj/machinery/clonepod/pod in pods) if(!(pod.occupant || pod.mess) && (pod.efficiency > 5)) From 5020c3a162d415d84772416a9d19e7c12eff90be Mon Sep 17 00:00:00 2001 From: joep van der velden Date: Fri, 29 Mar 2019 09:15:48 +0100 Subject: [PATCH 3/7] Check in scan instead --- code/game/machinery/computer/cloning.dm | 29 ++++++++++++------------- 1 file changed, 14 insertions(+), 15 deletions(-) diff --git a/code/game/machinery/computer/cloning.dm b/code/game/machinery/computer/cloning.dm index 8c7599a3189..9aa66bade29 100644 --- a/code/game/machinery/computer/cloning.dm +++ b/code/game/machinery/computer/cloning.dm @@ -39,26 +39,12 @@ if(!length(records)) return - var/list/toClone = records.Copy() - var/datum/dna2/record/lastEntry = toClone[length(toClone)] // Most recently added record - // Prevent double cloning - for(var/obj/machinery/clonepod/pod in pods) - if(pod.occupant) - if(pod.occupant.ckey == null) // Uses soulhooks - for(var/datum/soullink/soulhook/hook in pod.sharedSoulhooks) //Check the soul hooks to see if the to be cloned person is in here - if(hook.soulowner.ckey == lastEntry.ckey) - toClone.Remove(lastEntry) // Guy is getting cloned so remove the entry - break - else if(pod.occupant.ckey == lastEntry.ckey) // Directly put in body - toClone.Remove(lastEntry) // Guy is getting cloned so remove the entry - break for(var/obj/machinery/clonepod/pod in pods) if(!(pod.occupant || pod.mess) && (pod.efficiency > 5)) - for(var/datum/dna2/record/R in toClone) + for(var/datum/dna2/record/R in records) if(!(pod.occupant || pod.mess)) if(pod.growclone(R)) - toClone.Remove(R) records.Remove(R) /obj/machinery/computer/cloning/proc/updatemodules() @@ -409,6 +395,19 @@ SSnanoui.update_uis(src) return + for(var/obj/machinery/clonepod/pod in pods) + if(pod.occupant) + if(pod.occupant.ckey == null) // Uses soulhooks + for(var/datum/soullink/soulhook/hook in pod.sharedSoulhooks) //Check the soul hooks to see if the to be cloned person is in here + if(hook.soulowner.ckey == subject.ckey) + scantemp = "Subject already getting cloned." + SSnanoui.update_uis(src) + return + else if(pod.occupant.ckey == subject.ckey) // Directly put in body + scantemp = "Subject already getting cloned." + SSnanoui.update_uis(src) + return + subject.dna.check_integrity() var/datum/dna2/record/R = new /datum/dna2/record() From a5401b40f114b602260b74d5e14f0dc8a579e886 Mon Sep 17 00:00:00 2001 From: joep van der velden Date: Sat, 30 Mar 2019 17:30:19 +0100 Subject: [PATCH 4/7] github suggestions --- code/game/machinery/computer/cloning.dm | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/code/game/machinery/computer/cloning.dm b/code/game/machinery/computer/cloning.dm index 9aa66bade29..7bb4b17930e 100644 --- a/code/game/machinery/computer/cloning.dm +++ b/code/game/machinery/computer/cloning.dm @@ -37,7 +37,7 @@ if(scanner.occupant && can_autoprocess()) scan_mob(scanner.occupant) - if(!length(records)) + if(!LAZYLEN(records)) return for(var/obj/machinery/clonepod/pod in pods) @@ -403,10 +403,6 @@ scantemp = "Subject already getting cloned." SSnanoui.update_uis(src) return - else if(pod.occupant.ckey == subject.ckey) // Directly put in body - scantemp = "Subject already getting cloned." - SSnanoui.update_uis(src) - return subject.dna.check_integrity() From 451253dc5bfc695d58282175e747d8cdd0ffa77d Mon Sep 17 00:00:00 2001 From: joep van der velden Date: Sat, 30 Mar 2019 17:31:54 +0100 Subject: [PATCH 5/7] one if --- code/game/machinery/computer/cloning.dm | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/code/game/machinery/computer/cloning.dm b/code/game/machinery/computer/cloning.dm index 7bb4b17930e..cbc3ebe7f67 100644 --- a/code/game/machinery/computer/cloning.dm +++ b/code/game/machinery/computer/cloning.dm @@ -396,13 +396,12 @@ return for(var/obj/machinery/clonepod/pod in pods) - if(pod.occupant) - if(pod.occupant.ckey == null) // Uses soulhooks - for(var/datum/soullink/soulhook/hook in pod.sharedSoulhooks) //Check the soul hooks to see if the to be cloned person is in here - if(hook.soulowner.ckey == subject.ckey) - scantemp = "Subject already getting cloned." - SSnanoui.update_uis(src) - return + if(pod.occupant && pod.occupant.ckey == null) + for(var/datum/soullink/soulhook/hook in pod.sharedSoulhooks) //Check the soul hooks to see if the to be cloned person is in here + if(hook.soulowner.ckey == subject.ckey) + scantemp = "Subject already getting cloned." + SSnanoui.update_uis(src) + return subject.dna.check_integrity() From c845e9860f36e193dbd8c811948161c2d598c5a9 Mon Sep 17 00:00:00 2001 From: joep van der velden Date: Tue, 2 Apr 2019 17:54:39 +0200 Subject: [PATCH 6/7] uses clonemind instead --- code/game/machinery/computer/cloning.dm | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/code/game/machinery/computer/cloning.dm b/code/game/machinery/computer/cloning.dm index cbc3ebe7f67..22d74f9d814 100644 --- a/code/game/machinery/computer/cloning.dm +++ b/code/game/machinery/computer/cloning.dm @@ -396,12 +396,10 @@ return for(var/obj/machinery/clonepod/pod in pods) - if(pod.occupant && pod.occupant.ckey == null) - for(var/datum/soullink/soulhook/hook in pod.sharedSoulhooks) //Check the soul hooks to see if the to be cloned person is in here - if(hook.soulowner.ckey == subject.ckey) - scantemp = "Subject already getting cloned." - SSnanoui.update_uis(src) - return + if(pod.occupant && pod.occupant.ckey == null && pod.clonemind == subject.mind) + scantemp = "Subject already getting cloned." + SSnanoui.update_uis(src) + return subject.dna.check_integrity() From 530ff1353f205d292c7a5cb801b907f4ff5d2d52 Mon Sep 17 00:00:00 2001 From: joep van der velden Date: Wed, 3 Apr 2019 09:31:25 +0200 Subject: [PATCH 7/7] no more ckey check required --- code/game/machinery/computer/cloning.dm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/code/game/machinery/computer/cloning.dm b/code/game/machinery/computer/cloning.dm index 22d74f9d814..acdbc1110f3 100644 --- a/code/game/machinery/computer/cloning.dm +++ b/code/game/machinery/computer/cloning.dm @@ -396,7 +396,7 @@ return for(var/obj/machinery/clonepod/pod in pods) - if(pod.occupant && pod.occupant.ckey == null && pod.clonemind == subject.mind) + if(pod.occupant && pod.clonemind == subject.mind) scantemp = "Subject already getting cloned." SSnanoui.update_uis(src) return