From e20355e2fa589d2e30d5d7afcc659208fb077e72 Mon Sep 17 00:00:00 2001 From: SkyratBot <59378654+SkyratBot@users.noreply.github.com> Date: Fri, 15 Jul 2022 18:05:04 +0200 Subject: [PATCH] [MIRROR] fixes runtime in eyesnatcher objective [MDB IGNORE] (#14904) * fixes runtime in eyesnatcher objective (#68291) var/mob/living/carbon/human/targets_current(line 74) would get added if the requirements are met to possible_targets(line 78) which would get copied by the list all_possible_targets. Then when the list would get iterate through in(line 85) the value we iterate with possible_target(datum/mind) would end up becoming null, so I added possible_target(datum/mind) instead of targets_current(mob/living) to the list of possible_targets(line 78), then through debugging I found out it got the right value. In line 95 I basically did a similar logic victim_mind(datum/mind) would get the value of pick(possible_targets)(datum/mind) and victim(mob/living) which mob the victims mind belongs to(victim_mind.current). When I had tested on a local server again I wouldnt recieve a runtime and through debugging I found out you would now get the correct values Essentially, the types were wrong * fixes runtime in eyesnatcher objective Co-authored-by: Salex08 <33989683+Salex08@users.noreply.github.com> --- .../antagonists/traitor/objectives/eyesnatching.dm | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/code/modules/antagonists/traitor/objectives/eyesnatching.dm b/code/modules/antagonists/traitor/objectives/eyesnatching.dm index 402f9b56136..d6275581b13 100644 --- a/code/modules/antagonists/traitor/objectives/eyesnatching.dm +++ b/code/modules/antagonists/traitor/objectives/eyesnatching.dm @@ -75,10 +75,10 @@ if(!targets_current.getorgan(/obj/item/organ/internal/eyes)) continue - possible_targets += targets_current + possible_targets += possible_target for(var/datum/traitor_objective/eyesnatching/objective as anything in possible_duplicates) - possible_targets -= objective.victim + possible_targets -= objective.victim?.mind if(try_target_late_joiners) var/list/all_possible_targets = possible_targets.Copy() @@ -92,8 +92,8 @@ if(!possible_targets.len) return FALSE //MISSION FAILED, WE'LL GET EM NEXT TIME - victim = pick(possible_targets) - var/datum/mind/victim_mind = victim.mind + var/datum/mind/victim_mind = pick(possible_targets) + victim = victim_mind.current replace_in_name("%TARGET%", victim_mind.name) replace_in_name("%JOB TITLE%", victim_mind.assigned_role.title)