From 4b25db5a5ddfdc189953000e7c5291c2d3930a1e Mon Sep 17 00:00:00 2001 From: Contrabang <91113370+Contrabang@users.noreply.github.com> Date: Wed, 16 Aug 2023 15:30:12 -0400 Subject: [PATCH] okay for real this time (#21887) --- code/game/machinery/camera/camera_presets.dm | 24 +++++--------------- 1 file changed, 6 insertions(+), 18 deletions(-) diff --git a/code/game/machinery/camera/camera_presets.dm b/code/game/machinery/camera/camera_presets.dm index 512dc58fe67..c3ea1f9fa37 100644 --- a/code/game/machinery/camera/camera_presets.dm +++ b/code/game/machinery/camera/camera_presets.dm @@ -33,29 +33,17 @@ upgradeXRay() upgradeMotion() -// AUTONAME - -/obj/machinery/camera/autoname - var/number = 0 //camera number in area - // This camera type automatically sets it's name to whatever the area that it's in is called. /obj/machinery/camera/autoname/Initialize(mapload) - number = 1 - var/area/A = get_area(src) - if(!A) - number = rand(1, 100) - c_tag = "Unknown #[number]" + var/static/list/autonames_in_areas = list() + + var/area/camera_area = get_area(src) + if(!camera_area) + c_tag = "Unknown #[rand(1, 100)]" stack_trace("Camera with tag [c_tag] was spawned without an area, please report this to your nearest coder.") return ..() - for(var/obj/machinery/camera/autoname/C in A.contents) - if(C == src) - continue - if(C.number) - number = max(number, C.number + 1) - - c_tag = "[sanitize(A.name)] #[number]" - + c_tag = "[sanitize(camera_area.name)] #[++autonames_in_areas[camera_area]]" // increase the number, then print it (this is what ++ before does) return ..() // We do this here so the camera is not added to the cameranet until it has a name. // CHECKS