mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2026-08-27 15:17:01 +01:00
[MIRROR] Fixes a spurious runtime in AI code (#26356)
* Fixes a spurious runtime in AI code (#81253) ## About The Pull Request Tin.  No more of this. It's been annoying downstream for the past few days, so here's the fix. `find_this_thing()` should not be getting called when `controller.pawn` is qdeleted so I just moved that check up a couple lines. ## Why It's Good For The Game Makes CI functional again. Tested downstream with 5 CI runs, the runtime did not occur in any of them where it was happening just about every run previously. ## Changelog 🆑 fix: fixes a runtime in AI search_tactic /🆑 * Fixes a spurious runtime in AI code --------- Co-authored-by: Bloop <13398309+vinylspiders@users.noreply.github.com>
This commit is contained in:
@@ -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)
|
||||
|
||||
@@ -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())
|
||||
|
||||
Reference in New Issue
Block a user