mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2026-08-23 05:00:55 +01:00
[no gbp] actually fixes bot access (#82809)
## About The Pull Request real fix to bots having AA. also i forgot to address simple bots in my previous attempt so this fixes them too ## Why It's Good For The Game fixes bots having AA ## Changelog 🆑 fix: all bots have their normal accesses restored /🆑
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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()
|
||||
|
||||
Reference in New Issue
Block a user