From 9435242acbb4189065f2a0ccffb9e63f1b87697d Mon Sep 17 00:00:00 2001 From: Ghom <42542238+Ghommie@users.noreply.github.com> Date: Tue, 16 Jan 2024 09:04:57 +0100 Subject: [PATCH] No runtimes when passing down an empty list to set_access() (#80925) ## About The Pull Request Emptying the access list of an ID is a totally legit thing to do, so let's stop throwing errors because vibebots have no access at all. ## Why It's Good For The Game Fewer runtimes. ## Changelog Nothing changes. --- code/game/objects/items/cards_ids.dm | 3 ++- code/modules/mob/living/basic/bots/_bots.dm | 3 +-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/code/game/objects/items/cards_ids.dm b/code/game/objects/items/cards_ids.dm index 7e819c56376..7ddf02823a2 100644 --- a/code/game/objects/items/cards_ids.dm +++ b/code/game/objects/items/cards_ids.dm @@ -356,7 +356,8 @@ var/list/wildcard_access = list() var/list/normal_access = list() - build_access_lists(new_access_list, normal_access, wildcard_access) + if(length(new_access_list)) + build_access_lists(new_access_list, normal_access, wildcard_access) // Check if we can add the wildcards. if(mode == ERROR_ON_FAIL) diff --git a/code/modules/mob/living/basic/bots/_bots.dm b/code/modules/mob/living/basic/bots/_bots.dm index f8b273804ea..8462f4afc35 100644 --- a/code/modules/mob/living/basic/bots/_bots.dm +++ b/code/modules/mob/living/basic/bots/_bots.dm @@ -546,8 +546,7 @@ GLOBAL_LIST_INIT(command_strings, list( /mob/living/basic/bot/proc/bot_reset(bypass_ai_reset = FALSE) SEND_SIGNAL(src, COMSIG_BOT_RESET) - if(length(initial_access)) - access_card.set_access(initial_access) + access_card.set_access(initial_access) diag_hud_set_botstat() diag_hud_set_botmode() clear_path_hud()