diff --git a/_maps/map_files/MetaStation/MetaStation.dmm b/_maps/map_files/MetaStation/MetaStation.dmm index 6e2d0f76424..fc6add0976e 100644 --- a/_maps/map_files/MetaStation/MetaStation.dmm +++ b/_maps/map_files/MetaStation/MetaStation.dmm @@ -46455,7 +46455,7 @@ /obj/machinery/door/window/right/directional/south{ dir = 8; name = "Jim Norton's Quebecois Coffee"; - req_one_access_txt = list("service","maint_tunnels") + req_one_access = list("service","maint_tunnels") }, /obj/effect/turf_decal/trimline/green/line, /turf/open/floor/iron/dark, @@ -50123,7 +50123,7 @@ /obj/machinery/button/door{ id = "ordnancebridge"; pixel_x = -24; - req_one_access_txt = list("maint_tunnels","science") + req_one_access = list("maint_tunnels","science") }, /obj/effect/turf_decal/caution/stand_clear{ dir = 1 @@ -50356,7 +50356,7 @@ /obj/machinery/button/door{ id = "ordnancebridge"; pixel_y = 24; - req_one_access_txt = list("maint_tunnels","science") + req_one_access = list("maint_tunnels","science") }, /obj/effect/turf_decal/caution/stand_clear{ dir = 4 diff --git a/_maps/map_files/tramstation/modular_pieces/maintenance_upperbridgeright_1.dmm b/_maps/map_files/tramstation/modular_pieces/maintenance_upperbridgeright_1.dmm index b26826a8a91..351cdddeccf 100644 --- a/_maps/map_files/tramstation/modular_pieces/maintenance_upperbridgeright_1.dmm +++ b/_maps/map_files/tramstation/modular_pieces/maintenance_upperbridgeright_1.dmm @@ -44,7 +44,7 @@ /obj/effect/turf_decal/delivery/red, /obj/item/key/security, /obj/machinery/door/window/left/directional/north{ - req_access_txt = "security"; + req_access = list("security"); name = "Secway Storage" }, /turf/open/floor/iron/smooth, diff --git a/_maps/map_files/tramstation/modular_pieces/maintenance_upperbridgeright_2.dmm b/_maps/map_files/tramstation/modular_pieces/maintenance_upperbridgeright_2.dmm index f845fae10d9..7bed8217832 100644 --- a/_maps/map_files/tramstation/modular_pieces/maintenance_upperbridgeright_2.dmm +++ b/_maps/map_files/tramstation/modular_pieces/maintenance_upperbridgeright_2.dmm @@ -352,7 +352,7 @@ /obj/item/key/security, /obj/machinery/door/window/left/directional/north{ name = "Secway Storage"; - req_access_txt = "security" + req_access = list("security") }, /turf/open/floor/iron/smooth, /area/station/maintenance/department/security) diff --git a/code/game/machinery/buttons.dm b/code/game/machinery/buttons.dm index 004222a0ee5..c219c4814c6 100644 --- a/code/game/machinery/buttons.dm +++ b/code/game/machinery/buttons.dm @@ -39,9 +39,9 @@ src.check_access(null) - if(req_access.len || req_one_access.len) + if(length(req_access) || length(req_one_access)) board = new(src) - if(req_access.len) + if(length(req_access)) board.accesses = req_access else board.one_access = 1 diff --git a/code/game/machinery/doors/airlock.dm b/code/game/machinery/doors/airlock.dm index b30f8c38cae..458f65622d7 100644 --- a/code/game/machinery/doors/airlock.dm +++ b/code/game/machinery/doors/airlock.dm @@ -1364,7 +1364,6 @@ var/obj/item/electronics/airlock/ae if(!electronics) ae = new/obj/item/electronics/airlock(loc) - gen_access() if(length(req_one_access)) ae.one_access = 1 ae.accesses = req_one_access diff --git a/code/game/machinery/doors/airlock_types.dm b/code/game/machinery/doors/airlock_types.dm index 1b60b2539bf..618bc71cfa7 100644 --- a/code/game/machinery/doors/airlock_types.dm +++ b/code/game/machinery/doors/airlock_types.dm @@ -335,7 +335,7 @@ /obj/machinery/door/airlock/external/Initialize(mapload, ...) // default setting is for mapping only, let overrides work - if(!mapload || req_access_txt || req_one_access_txt) + if(!mapload) req_access = null return ..() diff --git a/code/game/objects/objs.dm b/code/game/objects/objs.dm index e6a4f8ceab7..78a08c351e7 100644 --- a/code/game/objects/objs.dm +++ b/code/game/objects/objs.dm @@ -28,10 +28,13 @@ var/infinite_reskin = FALSE // Access levels, used in modules\jobs\access.dm + /// List of accesses needed to use this object: The user must possess all accesses in this list in order to use the object. + /// Example: If req_access = list(ACCESS_ENGINE, ACCESS_CE)- then the user must have both ACCESS_ENGINE and ACCESS_CE in order to use the object. var/list/req_access - var/req_access_txt = "0" + /// List of accesses needed to use this object: The user must possess at least one access in this list in order to use the object. + /// Example: If req_one_access = list(ACCESS_ENGINE, ACCESS_CE)- then the user must have either ACCESS_ENGINE or ACCESS_CE in order to use the object. var/list/req_one_access - var/req_one_access_txt = "0" + /// Custom fire overlay icon var/custom_fire_overlay diff --git a/code/game/objects/structures/crates_lockers/closets.dm b/code/game/objects/structures/crates_lockers/closets.dm index 092ad7726ba..563e475ef5c 100644 --- a/code/game/objects/structures/crates_lockers/closets.dm +++ b/code/game/objects/structures/crates_lockers/closets.dm @@ -490,7 +490,6 @@ var/obj/item/electronics/airlock/electronics_ref if (!electronics) electronics_ref = new /obj/item/electronics/airlock(loc) - gen_access() if (req_one_access.len) electronics_ref.one_access = 1 electronics_ref.accesses = req_one_access diff --git a/code/modules/jobs/access.dm b/code/modules/jobs/access.dm index 42837d56d0c..53d0dd58754 100644 --- a/code/modules/jobs/access.dm +++ b/code/modules/jobs/access.dm @@ -53,35 +53,11 @@ /obj/item/proc/InsertID() return FALSE -/obj/proc/text2access(access_text) - . = list() - if(!access_text) - return - var/list/split = splittext(access_text,";") - for(var/x in split) - var/n = text2num(x) - if(n) - . += n - -//Call this before using req_access or req_one_access directly -/obj/proc/gen_access() - //These generations have been moved out of /obj/New() because they were slowing down the creation of objects that never even used the access system. - if(!req_access) - req_access = list() - for(var/a in text2access(req_access_txt)) - req_access += a - if(!req_one_access) - req_one_access = list() - for(var/b in text2access(req_one_access_txt)) - req_one_access += b - // Check if an item has access to this object /obj/proc/check_access(obj/item/I) return check_access_list(I ? I.GetAccess() : null) /obj/proc/check_access_list(list/access_list) - gen_access() - if(!islist(req_access)) //something's very wrong return TRUE diff --git a/code/modules/vending/_vending.dm b/code/modules/vending/_vending.dm index a101451ac50..605b2887070 100644 --- a/code/modules/vending/_vending.dm +++ b/code/modules/vending/_vending.dm @@ -169,10 +169,6 @@ ///A variable to change on a per instance basis on the map that allows the instance to force cost and ID requirements var/onstation_override = FALSE //change this on the object on the map to override the onstation check. DO NOT APPLY THIS GLOBALLY. - ///ID's that can load this vending machine wtih refills - var/list/canload_access_list - - var/list/vending_machine_input = list() ///Display header on the input view var/input_display_header = "Custom Vendor" @@ -806,30 +802,17 @@ . = ..() /** - * Is the passed in user allowed to load this vending machines compartments + * Is the passed in user allowed to load this vending machines compartments? This only is ran if we are using a /obj/item/storage/bag to load the vending machine, and not a dedicated restocker. * * Arguments: * * user - mob that is doing the loading of the vending machine */ /obj/machinery/vending/proc/compartmentLoadAccessCheck(mob/user) - if(!canload_access_list) + if(!req_access || allowed(user) || (obj_flags & EMAGGED) || !scan_id) return TRUE - else - var/do_you_have_access = FALSE - var/req_access_txt_holder = req_access_txt - for(var/i in canload_access_list) - req_access_txt = i - if(!allowed(user) && !(obj_flags & EMAGGED) && scan_id) - continue - else - do_you_have_access = TRUE - break //you passed don't bother looping anymore - req_access_txt = req_access_txt_holder // revert to normal (before the proc ran) - if(do_you_have_access) - return TRUE - else - to_chat(user, span_warning("[src]'s input compartment blinks red: Access denied.")) - return FALSE + + to_chat(user, span_warning("[src]'s input compartment blinks red: Access denied.")) + return FALSE /obj/machinery/vending/exchange_parts(mob/user, obj/item/storage/part_replacer/W) if(!istype(W)) diff --git a/code/modules/vending/snack.dm b/code/modules/vending/snack.dm index 251afbce76b..22d17761bf1 100644 --- a/code/modules/vending/snack.dm +++ b/code/modules/vending/snack.dm @@ -35,7 +35,7 @@ /obj/item/food/pistachios = 3, ) refill_canister = /obj/item/vending_refill/snack - canload_access_list = list(ACCESS_KITCHEN) + req_access = list(ACCESS_KITCHEN) default_price = PAYCHECK_CREW * 0.6 extra_price = PAYCHECK_CREW payment_department = ACCOUNT_SRV diff --git a/code/modules/wiremod/components/id/access_checker.dm b/code/modules/wiremod/components/id/access_checker.dm index f578bfd1575..038f4078ecb 100644 --- a/code/modules/wiremod/components/id/access_checker.dm +++ b/code/modules/wiremod/components/id/access_checker.dm @@ -16,10 +16,6 @@ "id-card" = "access", ) -/obj/item/circuit_component/compare/access/Initialize(mapload) - . = ..() - gen_access() - /obj/item/circuit_component/compare/access/get_ui_notices() . = ..() . += create_ui_notice("When \"Check Any\" is true, returns true if \"Access To Check\" contains ANY value in \"Required Access\".", "orange", "info")