diff --git a/code/datums/ai/generic/find_and_set.dm b/code/datums/ai/generic/find_and_set.dm index e06df971561..fbddc33075c 100644 --- a/code/datums/ai/generic/find_and_set.dm +++ b/code/datums/ai/generic/find_and_set.dm @@ -11,8 +11,11 @@ if (controller.blackboard_key_exists(set_key)) finish_action(controller, TRUE) return + if(QDELETED(controller.pawn)) + finish_action(controller, FALSE) + return var/find_this_thing = search_tactic(controller, locate_path, search_range) - if(QDELETED(controller.pawn) || isnull(find_this_thing)) + if(isnull(find_this_thing)) finish_action(controller, FALSE) return controller.set_blackboard_key(set_key, find_this_thing) diff --git a/code/modules/mob/living/basic/bots/cleanbot/cleanbot_ai.dm b/code/modules/mob/living/basic/bots/cleanbot/cleanbot_ai.dm index 3c49a322e51..537490c8431 100644 --- a/code/modules/mob/living/basic/bots/cleanbot/cleanbot_ai.dm +++ b/code/modules/mob/living/basic/bots/cleanbot/cleanbot_ai.dm @@ -75,6 +75,8 @@ var/list/found = typecache_filter_list(oview(search_range, controller.pawn), locate_paths) var/list/ignore_list = controller.blackboard[BB_TEMPORARY_IGNORE_LIST] for(var/atom/found_item in found) + if(QDELETED(controller.pawn)) + break if(LAZYACCESS(ignore_list, REF(found_item))) continue var/list/path = get_path_to(controller.pawn, found_item, max_distance = BOT_CLEAN_PATH_LIMIT, access = controller.get_access())