mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2026-07-14 09:35:30 +01:00
5f35bdee00
## About The Pull Request <img width="491" height="301" alt="image" src="https://github.com/user-attachments/assets/a3b5b19f-edf5-4de9-9201-9cbfab9e8827" /> Mod computers with the access changing software installed have a secondary ID slot once again. This ID slot doesn't contribute to access. You can insert IDs into the slot with right click and remove them with alt-right click. Also removes the "New IDs and you" memo paper. Also tweaks PDA on_deconstruct so contents are dropped on when they're deconstructed with assembly. Fixes #92151 ## Why It's Good For The Game Changing IDs is very unnecessarily clunky with the one slot. Insert hop id, log in, remove hop id, insert crew id, change access, remove crew id, log out. We had it right back when we had two slots. Insert hop ID, insert crew id, log in. It just works. This also allows for mobile HoPs to change access without necessitating removing their ID from their PDA. Other changes: The "New IDs and you" memo is very old. They haven't been new for 4 years now. I don't think anyone reads it and they served their purpose. I found it odd that, if your PDA was melted or blown up, it would delete your ID. If this is a hold-over from old PDA behavior feel free to let me know but otherwise it seems sensible that it'd spit out the contents as you would expect. ## Changelog 🆑 Melbert qol: The access changing software (the HoP console) now has ID two slots again (one for the HoP's id and one for the ID being changed). You can insert IDs in the secondary slot via the UI or right click, and remove them via the UI or alt-right click. qol: If your PDA is destroyed via acid or bombs, your ID (and similar contents such as disks) are spit out instead of being deleted del: Deletes the "New IDs and you" memo in the HoP's office. They haven't been new for 4 years. fix: Engineering sub-tab in the access changing software no longer looks messed up fix: Fix reversed alt-click logic for mod pcs /🆑 # Conflicts: # code/modules/modular_computers/computers/item/computer.dm
87 lines
2.9 KiB
Plaintext
87 lines
2.9 KiB
Plaintext
/**
|
|
* Returns TRUE if this mob has sufficient access to use this object
|
|
*
|
|
* * accessor - mob trying to access this object, !!CAN BE NULL!! because of telekiesis because we're in hell
|
|
*/
|
|
/atom/movable/proc/allowed(mob/accessor)
|
|
var/result_bitflags = SEND_SIGNAL(src, COMSIG_OBJ_ALLOWED, accessor)
|
|
if(result_bitflags & COMPONENT_OBJ_ALLOW)
|
|
return TRUE
|
|
if(result_bitflags & COMPONENT_OBJ_DISALLOW) // override all other checks
|
|
return FALSE
|
|
if(isnull(accessor)) //likely a TK user.
|
|
return check_access(null)
|
|
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
|
|
//check if it doesn't require any access at all
|
|
if(check_access(null))
|
|
return TRUE
|
|
if(HAS_SILICON_ACCESS(accessor))
|
|
if(ispAI(accessor))
|
|
return FALSE
|
|
if(!(ROLE_SYNDICATE in accessor.faction))
|
|
if((ACCESS_SYNDICATE in req_access) || (ACCESS_SYNDICATE_LEADER in req_access) || (ACCESS_SYNDICATE in req_one_access) || (ACCESS_SYNDICATE_LEADER in req_one_access))
|
|
return FALSE
|
|
if(onSyndieBase() && loc != accessor)
|
|
return FALSE
|
|
return TRUE //AI can do whatever it wants
|
|
//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
|
|
else if(ishuman(accessor))
|
|
var/mob/living/carbon/human/human_accessor = accessor
|
|
if(check_access(human_accessor.wear_id))
|
|
return TRUE
|
|
//if they have a hacky abstract animal ID with the required access, let them in i guess...
|
|
else if(isanimal(accessor))
|
|
var/mob/living/simple_animal/animal = accessor
|
|
if(check_access(animal.access_card))
|
|
return TRUE
|
|
else if(isbrain(accessor))
|
|
var/obj/item/mmi/brain_mmi = get(accessor.loc, /obj/item/mmi)
|
|
if(brain_mmi && ismecha(brain_mmi.loc))
|
|
var/obj/vehicle/sealed/mecha/big_stompy_robot = brain_mmi.loc
|
|
return check_access_list(big_stompy_robot.accesses)
|
|
return FALSE
|
|
|
|
// Check if an item has access to this object
|
|
/atom/movable/proc/check_access(obj/item/I)
|
|
return check_access_list(I ? I.GetAccess() : null)
|
|
|
|
/atom/movable/proc/check_access_list(list/access_list)
|
|
if(!length(req_access) && !length(req_one_access))
|
|
return TRUE
|
|
|
|
if(!length(access_list) || !islist(access_list))
|
|
return FALSE
|
|
|
|
for(var/req in req_access)
|
|
if(!(req in access_list)) //doesn't have this access
|
|
return FALSE
|
|
|
|
if(length(req_one_access))
|
|
for(var/req in req_one_access)
|
|
if(req in access_list) //has an access from the single access list
|
|
return TRUE
|
|
return FALSE
|
|
return TRUE
|
|
|
|
/obj/item/proc/GetAccess()
|
|
return list()
|
|
|
|
/obj/item/proc/GetID()
|
|
return null
|
|
|
|
/obj/item/proc/remove_id()
|
|
return null
|
|
|
|
/obj/item/proc/insert_id()
|
|
return FALSE
|