[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
🆑
fix: mothroaches will no longer be crawling out of bags every minute
/🆑

* [no gbp] fixes mothroach glutton

---------

Co-authored-by: Ben10Omintrix <138636438+Ben10Omintrix@users.noreply.github.com>
This commit is contained in:
SkyratBot
2024-07-15 10:05:07 +05:30
committed by GitHub
co-authored by Ben10Omintrix
parent 043824d941
commit a6a8bcdc42
@@ -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