From 1831456cb44fe67e7620e9fbfefd205f5a34f90e Mon Sep 17 00:00:00 2001 From: NovaBot <154629622+NovaBot13@users.noreply.github.com> Date: Mon, 5 Feb 2024 14:05:16 -0500 Subject: [PATCH] [MIRROR] Fixes a spurious runtime in AI code (#784) * Fixes a spurious runtime in AI code * Update TODO * Fixes this nonmodular edit --------- Co-authored-by: Bloop <13398309+vinylspiders@users.noreply.github.com> --- code/datums/ai/generic/find_and_set.dm | 8 ++++++++ .../modules/mob/living/basic/bots/cleanbot/cleanbot_ai.dm | 5 +++++ .../code/modules/jobs/job_types/spawner/ghost_role.dm | 2 ++ tgstation.dme | 1 + 4 files changed, 16 insertions(+) create mode 100644 modular_nova/master_files/code/modules/jobs/job_types/spawner/ghost_role.dm diff --git a/code/datums/ai/generic/find_and_set.dm b/code/datums/ai/generic/find_and_set.dm index e06df971561..cca87ac3e03 100644 --- a/code/datums/ai/generic/find_and_set.dm +++ b/code/datums/ai/generic/find_and_set.dm @@ -11,8 +11,16 @@ if (controller.blackboard_key_exists(set_key)) finish_action(controller, TRUE) return +<<<<<<< HEAD var/find_this_thing = search_tactic(controller, locate_path, search_range) if(QDELETED(controller.pawn) || isnull(find_this_thing)) +======= + if(QDELETED(controller.pawn)) + finish_action(controller, FALSE) + return + var/find_this_thing = search_tactic(controller, locate_path, search_range) + if(isnull(find_this_thing)) +>>>>>>> e43ff5c27 ([MIRROR] Fixes a spurious runtime in AI code (#784)) 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..5a69639a2eb 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,11 @@ 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) +<<<<<<< HEAD +======= + if(QDELETED(controller.pawn)) + break +>>>>>>> e43ff5c27 ([MIRROR] Fixes a spurious runtime in AI code (#784)) 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()) diff --git a/modular_nova/master_files/code/modules/jobs/job_types/spawner/ghost_role.dm b/modular_nova/master_files/code/modules/jobs/job_types/spawner/ghost_role.dm new file mode 100644 index 00000000000..fa622912aee --- /dev/null +++ b/modular_nova/master_files/code/modules/jobs/job_types/spawner/ghost_role.dm @@ -0,0 +1,2 @@ +/datum/job/ghost_role + paycheck = PAYCHECK_ZERO diff --git a/tgstation.dme b/tgstation.dme index 4d0d2972688..df98b707294 100644 --- a/tgstation.dme +++ b/tgstation.dme @@ -6444,6 +6444,7 @@ #include "modular_nova\master_files\code\modules\jobs\job_types\spawner\blackmarket.dm" #include "modular_nova\master_files\code\modules\jobs\job_types\spawner\ds2.dm" #include "modular_nova\master_files\code\modules\jobs\job_types\spawner\freighter_crew.dm" +#include "modular_nova\master_files\code\modules\jobs\job_types\spawner\ghost_role.dm" #include "modular_nova\master_files\code\modules\jobs\job_types\spawner\ghostcafe.dm" #include "modular_nova\master_files\code\modules\jobs\job_types\spawner\interdyne_planetary_base.dm" #include "modular_nova\master_files\code\modules\jobs\job_types\spawner\tarkon.dm"