From bb0f6845795cd15f9354f06a0226573d406d4ace Mon Sep 17 00:00:00 2001 From: Contrabang <91113370+Contrabang@users.noreply.github.com> Date: Mon, 26 Sep 2022 10:57:38 -0400 Subject: [PATCH] I cant use : here, maintainers would kill me --- code/datums/mind.dm | 2 ++ code/game/gamemodes/objective.dm | 11 ++++++++++- 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/code/datums/mind.dm b/code/datums/mind.dm index 53576887361..bcfb14a36a8 100644 --- a/code/datums/mind.dm +++ b/code/datums/mind.dm @@ -747,6 +747,8 @@ if(!new_objective) return + new_objective.post_admin_creation() + if(objective) remove_objective(objective) if(objective_pos[2]) diff --git a/code/game/gamemodes/objective.dm b/code/game/gamemodes/objective.dm index c939fef0ba6..1d941830b86 100644 --- a/code/game/gamemodes/objective.dm +++ b/code/game/gamemodes/objective.dm @@ -89,6 +89,12 @@ GLOBAL_LIST_INIT(potential_theft_objectives, (subtypesof(/datum/theft_objective) qdel(src) owner?.announce_objectives() +/** + * Called when an admin creates a objective, allowing for variables to be set post-target selection + */ +/datum/objective/proc/post_admin_creation() + return + /datum/objective/assassinate martyr_compatible = 1 @@ -351,6 +357,9 @@ GLOBAL_LIST_INIT(potential_theft_objectives, (subtypesof(/datum/theft_objective) else explanation_text = "Free Objective" +/datum/objective/escape/escape_with_identity/post_admin_creation() + target_real_name = target.current.real_name + /datum/objective/escape/escape_with_identity/check_completion() if(!target_real_name) return 1 @@ -359,7 +368,7 @@ GLOBAL_LIST_INIT(potential_theft_objectives, (subtypesof(/datum/theft_objective) var/mob/living/carbon/human/H = owner.current if(..()) if(H.dna.real_name == target_real_name) - if(H.get_id_name()== target_real_name) + if(H.get_id_name() == target_real_name) return 1 return 0