mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2026-08-22 12:41:09 +01:00
[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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user