diff --git a/code/modules/jobs/access.dm b/code/modules/jobs/access.dm index 2055080710e..b31574bec33 100644 --- a/code/modules/jobs/access.dm +++ b/code/modules/jobs/access.dm @@ -19,6 +19,12 @@ if(isAdminGhostAI(accessor)) //Access can't stop the abuse return TRUE + //If the mob has the simple_access component with the requried access, we let them in. + var/attempted_access = SEND_SIGNAL(accessor, COMSIG_MOB_TRIED_ACCESS, src) + if(attempted_access & ACCESS_ALLOWED) + return TRUE + if(attempted_access & ACCESS_DISALLOWED) + return FALSE if(HAS_SILICON_ACCESS(accessor)) if(ispAI(accessor)) return FALSE @@ -28,9 +34,6 @@ if(onSyndieBase() && loc != accessor) return FALSE return TRUE //AI can do whatever it wants - //If the mob has the simple_access component with the requried access, we let them in. - else if(SEND_SIGNAL(accessor, COMSIG_MOB_TRIED_ACCESS, src) & ACCESS_ALLOWED) - return TRUE //If the mob is holding a valid ID, we let them in. get_active_held_item() is on the mob level, so no need to copypasta everywhere. else if(check_access(accessor.get_active_held_item()) || check_access(accessor.get_inactive_held_item())) return TRUE diff --git a/code/modules/mob/living/basic/bots/_bots.dm b/code/modules/mob/living/basic/bots/_bots.dm index ccd4b0d617f..d98369294e0 100644 --- a/code/modules/mob/living/basic/bots/_bots.dm +++ b/code/modules/mob/living/basic/bots/_bots.dm @@ -104,7 +104,7 @@ GLOBAL_LIST_INIT(command_strings, list( AddElement(/datum/element/relay_attackers) RegisterSignal(src, COMSIG_MOVABLE_MOVED, PROC_REF(handle_loop_movement)) RegisterSignal(src, COMSIG_ATOM_WAS_ATTACKED, PROC_REF(after_attacked)) - RegisterSignal(src, COMSIG_OBJ_ALLOWED, PROC_REF(attempt_access)) + RegisterSignal(src, COMSIG_MOB_TRIED_ACCESS, PROC_REF(attempt_access)) ADD_TRAIT(src, TRAIT_NO_GLIDE, INNATE_TRAIT) GLOB.bots_list += src @@ -757,7 +757,7 @@ GLOBAL_LIST_INIT(command_strings, list( /mob/living/basic/bot/proc/attempt_access(mob/bot, obj/door_attempt) SIGNAL_HANDLER - return (door_attempt.check_access(access_card) ? COMPONENT_OBJ_ALLOW : COMPONENT_OBJ_DISALLOW) + return (door_attempt.check_access(access_card) ? ACCESS_ALLOWED : ACCESS_DISALLOWED) /mob/living/basic/bot/proc/generate_speak_list() return null diff --git a/code/modules/mob/living/simple_animal/bot/bot.dm b/code/modules/mob/living/simple_animal/bot/bot.dm index ec204dbc82b..944a00af9b6 100644 --- a/code/modules/mob/living/simple_animal/bot/bot.dm +++ b/code/modules/mob/living/simple_animal/bot/bot.dm @@ -204,6 +204,7 @@ pa_system = new(src, automated_announcements = automated_announcements) pa_system.Grant(src) + RegisterSignal(src, COMSIG_MOB_TRIED_ACCESS, PROC_REF(attempt_access)) /mob/living/simple_animal/bot/Destroy() GLOB.bots_list -= src @@ -951,13 +952,13 @@ Pass a positive integer as an argument to override a bot's default speed. calc_summon_path() tries = 0 -/mob/living/simple_animal/bot/Bump(atom/A) //Leave no door unopened! - . = ..() - if((istype(A, /obj/machinery/door/airlock) || istype(A, /obj/machinery/door/window)) && (!isnull(access_card))) - var/obj/machinery/door/D = A - if(D.check_access(access_card)) - D.open() - frustration = 0 +/mob/living/simple_animal/bot/proc/attempt_access(mob/bot, obj/door_attempt) + SIGNAL_HANDLER + + if(door_attempt.check_access(access_card)) + frustration = 0 + return ACCESS_ALLOWED + return ACCESS_DISALLOWED /mob/living/simple_animal/bot/ui_data(mob/user) var/list/data = list()