[No GBP] Traders use Pick() to select their first customer (#79455)

## About The Pull Request

In my trader PR, I made
`/datum/ai_behavior/find_and_set/conscious_person` return the first
person the trader found, since all they had to know was that they found
someone. However, I realized that I made the jumpscare subtype actually
move towards the target, meaning they would always move to the first
target they found in their vision range. This PR makes them use Pick().

## Why It's Good For The Game

Its good if an AI randomly picks from a search list instead of returning
the first one.

## Changelog

Nothing player facing
This commit is contained in:
Profakos
2023-11-06 15:34:00 +01:00
committed by GitHub
parent c31dd05f31
commit ebc8ac7dc2
+7 -1
View File
@@ -142,7 +142,13 @@
/datum/ai_behavior/find_and_set/conscious_person
/datum/ai_behavior/find_and_set/conscious_person/search_tactic(datum/ai_controller/controller, locate_path, search_range)
var/list/customers = list()
for(var/mob/living/carbon/human/target in oview(search_range, controller.pawn))
if(IS_DEAD_OR_INCAP(target) || !target.mind)
continue
return target
customers += target
if(customers.len)
return pick(customers)
return null