mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2026-08-22 12:41:09 +01:00
allowed is now signals based instead of hardcoded slots (#94871)
## About The Pull Request ID cards/MMI mech access/simple mob access/pAIs now use signals instead of checking specific slots with mob checks. We do this through mob's ``get_access`` proc that collects all access a mob has with a collect_access signal. ## Why It's Good For The Game It looks cleaner and we no longer individually check `check_access` for every single item that may have access. It's cleaner to put it all together and check in one go with all the access we've got. This also makes it easier to add items that hold access that aren't necessarily IDs but you want to be able to open stuff with. ## Changelog 🆑 refactor: ID checking for access has been reworked, please make a bug report if anything that's supposed to grant access is not working. /🆑 --------- Co-authored-by: MrMelbert <51863163+MrMelbert@users.noreply.github.com>
This commit is contained in:
co-authored by
MrMelbert
parent
24dc2fac96
commit
aedc5bae7a
@@ -31,7 +31,7 @@
|
||||
return FALSE
|
||||
|
||||
/obj/machinery/door/airlock/shell/allowed(mob/user)
|
||||
if(SEND_SIGNAL(src, COMSIG_AIRLOCK_SHELL_ALLOWED, user) & COMPONENT_OBJ_ALLOW)
|
||||
if(SEND_SIGNAL(src, COMSIG_AIRLOCK_SHELL_ALLOWED, user) & ACCESS_ALLOWED)
|
||||
return TRUE
|
||||
return isAdminGhostAI(user)
|
||||
|
||||
@@ -157,14 +157,12 @@
|
||||
if(istype(shell, /obj/machinery/door/airlock))
|
||||
attached_airlock = shell
|
||||
RegisterSignals(shell, list(
|
||||
COMSIG_OBJ_ALLOWED,
|
||||
COMSIG_AIRLOCK_SHELL_ALLOWED,
|
||||
), PROC_REF(handle_allowed))
|
||||
|
||||
/obj/item/circuit_component/airlock_access_event/unregister_shell(atom/movable/shell)
|
||||
attached_airlock = null
|
||||
UnregisterSignal(shell, list(
|
||||
COMSIG_OBJ_ALLOWED,
|
||||
COMSIG_AIRLOCK_SHELL_ALLOWED
|
||||
))
|
||||
return ..()
|
||||
@@ -197,6 +195,6 @@
|
||||
return
|
||||
|
||||
if(result["should_open"])
|
||||
return COMPONENT_OBJ_ALLOW
|
||||
return ACCESS_ALLOWED
|
||||
else
|
||||
return COMPONENT_OBJ_DISALLOW
|
||||
return ACCESS_DISALLOWED
|
||||
|
||||
Reference in New Issue
Block a user