[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>
This commit is contained in:
SkyratBot
2022-07-15 17:05:04 +01:00
committed by GitHub
co-authored by Salex08
parent d7bd8d3a31
commit e20355e2fa
@@ -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)