expanded find_target_by_role

This commit is contained in:
alex-gh
2014-04-09 01:31:37 +02:00
parent 7f6fc76f3d
commit d55450f591
+5 -4
View File
@@ -37,11 +37,12 @@ datum/objective
proc/find_target_by_role(role, role_type=0)//Option sets either to check assigned role or special role. Default to assigned.
var/list/possible_targets = list()
for(var/datum/mind/possible_target in ticker.minds)
if((possible_target != owner) && ishuman(possible_target.current) && ((role_type ? possible_target.special_role : possible_target.assigned_role) == role) )
target = possible_target
break
if((possible_target != owner) && ishuman(possible_target.current) && ((role_type ? possible_target.special_role : possible_target.assigned_role) == role) && (possible_target.current.stat != 2) )
possible_targets += possible_target
if(possible_targets.len > 0)
target = pick(possible_targets)
datum/objective/assassinate