From f31b2794b5886c9b2a7b63c780f6c09ff9582dbb Mon Sep 17 00:00:00 2001 From: Ben10Omintrix <138636438+Ben10Omintrix@users.noreply.github.com> Date: Thu, 25 Apr 2024 06:19:17 +0200 Subject: [PATCH] fixes ai controllers hard deletes (#82861) ## About The Pull Request ![image](https://github.com/tgstation/tgstation/assets/138636438/47010ad2-64ef-40dd-94d3-b928e4216d1b) i noticed almost all ai controllers were being hard deleted, its because the controller itself was being addedto the behavior_cooldowns list rather than the behavior itself ## Why It's Good For The Game fixes hard deletes ## Changelog :cl: /:cl: --- code/datums/ai/basic_mobs/basic_ai_behaviors/targeting.dm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/code/datums/ai/basic_mobs/basic_ai_behaviors/targeting.dm b/code/datums/ai/basic_mobs/basic_ai_behaviors/targeting.dm index f227d5dfea6..f0ee4bb9bba 100644 --- a/code/datums/ai/basic_mobs/basic_ai_behaviors/targeting.dm +++ b/code/datums/ai/basic_mobs/basic_ai_behaviors/targeting.dm @@ -146,7 +146,7 @@ GLOBAL_LIST_INIT(target_interested_atoms, typecacheof(list(/mob, /obj/machinery/ var/datum/proximity_monitor/field = controller.blackboard[BB_FIND_TARGETS_FIELD(type)] qdel(field) // autoclears so it's fine controller.CancelActions() // On retarget cancel any further queued actions so that they will setup again with new target - controller.modify_cooldown(controller, get_cooldown(controller)) + controller.modify_cooldown(src, get_cooldown(controller)) /// Returns the desired final target from the filtered list of targets /datum/ai_behavior/find_potential_targets/proc/pick_final_target(datum/ai_controller/controller, list/filtered_targets)