diff --git a/code/game/machinery/camera/camera.dm b/code/game/machinery/camera/camera.dm index 9c7085c581d..865bf2f3cb8 100644 --- a/code/game/machinery/camera/camera.dm +++ b/code/game/machinery/camera/camera.dm @@ -39,7 +39,7 @@ assembly = new(src) assembly.state = 4 - invalidateCameraCache() + //invalidateCameraCache() /* // Use this to look for cameras that have the same c_tag. for(var/obj/machinery/camera/C in cameranet.cameras) @@ -66,7 +66,7 @@ /obj/machinery/camera/emp_act(severity) if(!isEmpProof()) if(prob(100/severity)) - invalidateCameraCache() + //invalidateCameraCache() stat |= EMPED SetLuminosity(0) kick_viewers() @@ -77,7 +77,7 @@ stat &= ~EMPED cancelCameraAlarm() update_icon() - invalidateCameraCache() + //invalidateCameraCache() ..() /obj/machinery/camera/bullet_act(var/obj/item/projectile/P) @@ -123,7 +123,7 @@ cameranet.updateVisibility(src, 0) /obj/machinery/camera/attackby(obj/W as obj, mob/living/user as mob) - invalidateCameraCache() + //invalidateCameraCache() // DECONSTRUCTION if(isscrewdriver(W)) //user << "You start to [panel_open ? "close" : "open"] the camera's panel." @@ -215,7 +215,7 @@ //legacy support, if choice is != 1 then just kick viewers without changing status kick_viewers() else - invalidateCameraCache() + //invalidateCameraCache() set_status( !src.status ) if (!(src.status)) visible_message("\red [user] has deactivated [src]!") @@ -235,7 +235,7 @@ //Used when someone breaks a camera /obj/machinery/camera/proc/destroy() - invalidateCameraCache() + //invalidateCameraCache() stat |= BROKEN kick_viewers() triggerCameraAlarm() @@ -250,7 +250,7 @@ /obj/machinery/camera/proc/set_status(var/newstatus) if (status != newstatus) status = newstatus - invalidateCameraCache() + //invalidateCameraCache() // now disconnect anyone using the camera //Apparently, this will disconnect anyone even if the camera was re-activated. //I guess that doesn't matter since they couldn't use it anyway? diff --git a/code/game/machinery/computer/camera.dm b/code/game/machinery/computer/camera.dm index e23ce2e3398..403c11ca3f4 100644 --- a/code/game/machinery/computer/camera.dm +++ b/code/game/machinery/computer/camera.dm @@ -81,46 +81,38 @@ var/data[0] + data["current"] = null - if(isnull(camera_cache)) - cameranet.process_sort() + var/list/L = list() + for (var/obj/machinery/camera/C in cameranet.cameras) + if(can_access_camera(C)) + L.Add(C) - var/cameras[0] - for(var/obj/machinery/camera/C in cameranet.cameras) - var/cam[0] - cam["name"] = C.c_tag - cam["deact"] = !C.can_use() - cam["camera"] = "\ref[C]" - cam["x"] = C.x - cam["y"] = C.y - cam["z"] = C.z + cameranet.process_sort() - cameras[++cameras.len] = cam + var/cameras[0] + for(var/obj/machinery/camera/C in L) + var/cam[0] + cam["name"] = C.c_tag + cam["deact"] = !C.can_use() + cam["camera"] = "\ref[C]" + cam["x"] = C.x + cam["y"] = C.y + cam["z"] = C.z - if(C == current) - data["current"] = cam - - var/list/camera_list = list("cameras" = cameras) - camera_cache=list2json(camera_list) - - else - if(current) - var/cam[0] - cam["name"] = current.c_tag - cam["deact"] = !current.can_use() - cam["camera"] = "\ref[current]" - cam["x"] = current.x - cam["y"] = current.y - cam["z"] = current.z + cameras[++cameras.len] = cam + if(C == current) data["current"] = cam + + data["cameras"] = cameras tempnets.Cut() if(emagged) access = list(access_captain) // Assume captain level access when emagged data["emagged"] = 1 - if(isAI(user) || isrobot (user)) + if(isAI(user) || isrobot(user)) access = list(access_captain) // Assume captain level access when AI // Loop through the ID's permission, and check which networks the ID has access to. @@ -145,8 +137,7 @@ ui.add_template("mapContent", "sec_camera_map_content.tmpl") // adding a template with the key "mapHeader" replaces the map header content ui.add_template("mapHeader", "sec_camera_map_header.tmpl") - - ui.load_cached_data(camera_cache) + ui.set_initial_data(data) ui.open() ui.set_auto_update(1) diff --git a/nano/templates/sec_camera.tmpl b/nano/templates/sec_camera.tmpl index 5aad1e29298..b9764555cd6 100644 --- a/nano/templates/sec_camera.tmpl +++ b/nano/templates/sec_camera.tmpl @@ -12,7 +12,7 @@ Used In File(s): \code\game\machinery\computer\camera.dm
None
{{/if}} -{{for data.cached.cameras}} +{{for data.cameras}} {{if data.current && value.name == data.current.name}} {{:helper.link(value.name, '', {'switchTo' : value.camera}, 'selected')}} {{else value.deact}} diff --git a/nano/templates/sec_camera_map_content.tmpl b/nano/templates/sec_camera_map_content.tmpl index d0abff84285..52dc8aeadd6 100644 --- a/nano/templates/sec_camera_map_content.tmpl +++ b/nano/templates/sec_camera_map_content.tmpl @@ -2,7 +2,7 @@ Title: Security Camera Console (Map content) Used In File(s): \code\game\machinery\computer\camera.dm --> -{{for data.cached.cameras}} +{{for data.cameras}} {{if value.z == 1}}
{{if data.current && value.name == data.current.name}}