Skip to content

Commit ff5b5fc

Browse files
committed
Add managing the temporary ignore list, so it's actually temporary
1 parent 55de498 commit ff5b5fc

File tree

3 files changed

+7
-0
lines changed

3 files changed

+7
-0
lines changed

monkestation/code/modules/slimecore/mobs/_base_slime.dm

+1
Original file line numberDiff line numberDiff line change
@@ -232,6 +232,7 @@
232232

233233
if(slime_flags & CLEANER_SLIME)
234234
ai_controller.clear_blackboard_key(BB_CLEAN_TARGET)
235+
new_planning_subtree |= add_or_replace_tree(/datum/ai_planning_subtree/manage_unreachable_list)
235236
new_planning_subtree |= add_or_replace_tree(/datum/ai_planning_subtree/cleaning_subtree_slime)
236237

237238
if(!(slime_flags & PASSIVE_SLIME))

monkestation/code/modules/slimecore/mobs/ai_controller/behaviours/clean_target.dm

+5
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,14 @@
2323
qdel(target) // Sent to the shadow realm to never be seen again
2424
finish_action(controller, TRUE, target_key)
2525

26+
// Copied from `/datum/ai_behavior/execute_clean/finish_action`, but only the parts wanted for
27+
// supporting cleaner slimes.
2628
/datum/ai_behavior/execute_clean_slime/finish_action(datum/ai_controller/controller, succeeded, target_key, targeting_strategy_key, hiding_location_key)
2729
. = ..()
2830
var/atom/target = controller.blackboard[target_key]
31+
if(!succeeded && !isnull(target))
32+
controller.clear_blackboard_key(target_key)
33+
controller.set_blackboard_key_assoc_lazylist(BB_TEMPORARY_IGNORE_LIST, REF(target), TRUE)
2934
if(QDELETED(target) || is_type_in_typecache(target, controller.blackboard[BB_HUNTABLE_TRASH]))
3035
return
3136
if(!iscarbon(target))

monkestation/code/modules/slimecore/mobs/ai_controller/controller.dm

+1
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
BB_BASIC_MOB_SCARED_ITEM = /obj/item/extinguisher,
77
BB_BASIC_MOB_STOP_FLEEING = TRUE,
88
BB_WONT_TARGET_CLIENTS = FALSE, //specifically to stop targetting clients
9+
BB_UNREACHABLE_LIST_COOLDOWN = 45 SECONDS, // how often we want to clear our unreachable list
910
)
1011

1112
ai_movement = /datum/ai_movement/basic_avoidance

0 commit comments

Comments
 (0)