From a6a8bcdc426c2b208049154c71fe25e26bbb72b6 Mon Sep 17 00:00:00 2001 From: SkyratBot <59378654+SkyratBot@users.noreply.github.com> Date: Mon, 15 Jul 2024 06:35:07 +0200 Subject: [PATCH] [MIRROR] [no gbp] fixes mothroach glutton (#28844) * [no gbp] fixes mothroach glutton (#84921) ## About The Pull Request mothroaches were eating their holder object so theyd constantly crawl out of bags ## Why It's Good For The Game closes #84825 ## Changelog :cl: fix: mothroaches will no longer be crawling out of bags every minute /:cl: * [no gbp] fixes mothroach glutton --------- Co-authored-by: Ben10Omintrix <138636438+Ben10Omintrix@users.noreply.github.com> --- .../living/basic/vermin/mothroach/mothroach_ai.dm | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/code/modules/mob/living/basic/vermin/mothroach/mothroach_ai.dm b/code/modules/mob/living/basic/vermin/mothroach/mothroach_ai.dm index 5ef330cdc64..5801d183215 100644 --- a/code/modules/mob/living/basic/vermin/mothroach/mothroach_ai.dm +++ b/code/modules/mob/living/basic/vermin/mothroach/mothroach_ai.dm @@ -27,9 +27,21 @@ SIGNAL_HANDLER set_blackboard_key(BB_MOTHROACH_NEXT_EAT, world.time + MOTHROACH_EAT_TIMER) +/datum/ai_planning_subtree/find_food/mothroach + finding_behavior = /datum/ai_behavior/find_and_set/in_list/mothroach_food + /datum/ai_planning_subtree/find_food/mothroach/SelectBehaviors(datum/ai_controller/controller, seconds_per_tick) if(world.time < controller.blackboard[BB_MOTHROACH_NEXT_EAT]) return return ..() +/datum/ai_behavior/find_and_set/in_list/mothroach_food + +/datum/ai_behavior/find_and_set/in_list/mothroach_food/search_tactic(datum/ai_controller/controller, locate_paths, search_range) + var/list/found = typecache_filter_list(oview(search_range, controller.pawn), locate_paths) + var/mob/living/living_pawn = controller.pawn + found -= living_pawn.loc + if(length(found)) + return pick(found) + #undef MOTHROACH_EAT_TIMER