Harddel Fix Pack #42 + Better Live Reftracking Support (#63877)

* Hard Del Fixes, Ref Tracking Changes
This commit is contained in:
LemonInTheDark
2022-01-12 13:46:13 -08:00
committed by GitHub
parent f3f7720d7e
commit f8aad14ae8
109 changed files with 865 additions and 733 deletions
@@ -15,7 +15,8 @@
program_icon = "eye"
var/list/network = list("ss13")
var/obj/machinery/camera/active_camera
/// Weakref to the active camera
var/datum/weakref/camera_ref
/// The turf where the camera was last updated.
var/turf/last_camera_turf
var/list/concurrent_users = list()
@@ -92,6 +93,7 @@
var/list/data = get_header_data()
data["network"] = network
data["activeCamera"] = null
var/obj/machinery/camera/active_camera = camera_ref?.resolve()
if(active_camera)
data["activeCamera"] = list(
name = active_camera.c_tag,
@@ -121,7 +123,7 @@
var/c_tag = params["name"]
var/list/cameras = get_available_cameras()
var/obj/machinery/camera/selected_camera = cameras[c_tag]
active_camera = selected_camera
camera_ref = WEAKREF(selected_camera)
playsound(src, get_sfx("terminal_type"), 25, FALSE)
if(!selected_camera)
@@ -141,10 +143,11 @@
user.client.clear_map(map_name)
// Turn off the console
if(length(concurrent_users) == 0 && is_living)
active_camera = null
camera_ref = null
playsound(src, 'sound/machines/terminal_off.ogg', 25, FALSE)
/datum/computer_file/program/secureye/proc/update_active_camera_screen()
var/obj/machinery/camera/active_camera = camera_ref?.resolve()
// Show static if can't use the camera
if(!active_camera?.can_use())
show_camera_static()