* fixxy fixxy

* uses is_invalid_target instead

* aa review, consistency

* wowee!

* Revert "wowee!"

This reverts commit cf1905092c.
This commit is contained in:
Contrabang
2022-09-25 12:37:53 -04:00
committed by GitHub
parent 157940350b
commit 096cdafce5
2 changed files with 17 additions and 8 deletions
+9 -3
View File
@@ -606,9 +606,12 @@
var/objective_type = "[objective_type_capital][objective_type_text]"//Add them together into a text string.
var/list/possible_targets = list()
var/list/possible_targets_random = list()
for(var/datum/mind/possible_target in SSticker.minds)
if((possible_target != src) && istype(possible_target.current, /mob/living/carbon/human))
possible_targets += possible_target.current
possible_targets += possible_target.current // Allows for admins to pick off station roles
if(!is_invalid_target(possible_target))
possible_targets_random += possible_target.current // For random picking, only valid targets
var/mob/def_target = null
var/objective_list[] = list(/datum/objective/assassinate, /datum/objective/protect, /datum/objective/debrain)
@@ -617,12 +620,15 @@
possible_targets = sortAtom(possible_targets)
var/new_target
if(length(possible_targets) > 0)
if(length(possible_targets))
if(alert(usr, "Do you want to pick the objective yourself? No will randomise it", "Pick objective", "Yes", "No") == "Yes")
possible_targets += "Free objective"
new_target = input("Select target:", "Objective target", def_target) as null|anything in possible_targets
else
new_target = pick(possible_targets)
if(!length(possible_targets_random))
to_chat(usr, "<span class='warning'>No random target found. Pick one manually.</span>")
return
new_target = pick(possible_targets_random)
if(!new_target)
return