diff --git a/code/game/machinery/computer/camera.dm b/code/game/machinery/computer/camera.dm index ec897f97e2..1d47155c33 100644 --- a/code/game/machinery/computer/camera.dm +++ b/code/game/machinery/computer/camera.dm @@ -139,8 +139,8 @@ var/list/visible_turfs = list() - // Is this camera located in or attached to a living thing? If so, assume the camera's loc is the living thing. - var/cam_location = isliving(active_camera.loc) ? active_camera.loc : active_camera + // Need to get camera's location or it + var/cam_location = get_atom_on_turf(active_camera) // If we're not forcing an update for some reason and the cameras are in the same location, // we don't need to update anything. diff --git a/code/modules/integrated_electronics/subtypes/output.dm b/code/modules/integrated_electronics/subtypes/output.dm index e0b1afe72e..a38d9ad5e2 100644 --- a/code/modules/integrated_electronics/subtypes/output.dm +++ b/code/modules/integrated_electronics/subtypes/output.dm @@ -269,9 +269,10 @@ inputs = list( "camera name" = IC_PINTYPE_STRING, "camera active" = IC_PINTYPE_BOOLEAN, + "camera fast mode" = IC_PINTYPE_BOOLEAN, "camera network" = IC_PINTYPE_LIST ) - inputs_default = list("1" = "video camera circuit", "3" = list("rd")) + inputs_default = list("1" = "video camera circuit", "4" = list("rd")) outputs = list() activators = list() spawn_flags = IC_SPAWN_DEFAULT|IC_SPAWN_RESEARCH @@ -280,6 +281,8 @@ var/obj/machinery/camera/camera var/updating = FALSE + var/update_speed = 10 // How often to update the camera + /obj/item/integrated_circuit/output/video_camera/New() ..() camera = new(src) @@ -290,11 +293,11 @@ QDEL_NULL(camera) return ..() -/obj/item/integrated_circuit/output/video_camera/proc/set_camera_status(var/status) +/obj/item/integrated_circuit/output/video_camera/proc/set_camera_status(status) if(camera) camera.status = status GLOB.cameranet.updatePortableCamera(camera) - power_draw_idle = camera.status ? 20 : 0 + power_draw_idle = camera.status ? (20 / (update_speed * 0.1)) : 0 if(camera.status) // Ensure that there's actually power. if(!draw_idle_power()) power_fail() @@ -303,7 +306,8 @@ if(camera) var/cam_name = get_pin_data(IC_INPUT, 1) var/cam_active = get_pin_data(IC_INPUT, 2) - var/list/new_network = get_pin_data(IC_INPUT, 3) + update_speed = get_pin_data(IC_INPUT, 3) ? 5 : 10 + var/list/new_network = get_pin_data(IC_INPUT, 4) if(!isnull(cam_name)) camera.c_tag = cam_name if(!isnull(new_network)) @@ -319,13 +323,11 @@ . = ..() update_camera_location(oldLoc) -#define VIDEO_CAMERA_BUFFER 10 /obj/item/integrated_circuit/output/video_camera/proc/update_camera_location(oldLoc) oldLoc = get_turf(oldLoc) if(!QDELETED(camera) && !updating && oldLoc != get_turf(src)) updating = TRUE - addtimer(CALLBACK(src, .proc/do_camera_update, oldLoc), VIDEO_CAMERA_BUFFER) -#undef VIDEO_CAMERA_BUFFER + addtimer(CALLBACK(src, .proc/do_camera_update, oldLoc), update_speed) /obj/item/integrated_circuit/output/video_camera/proc/do_camera_update(oldLoc) if(!QDELETED(camera) && oldLoc != get_turf(src)) diff --git a/code/modules/modular_computers/file_system/programs/secureye.dm b/code/modules/modular_computers/file_system/programs/secureye.dm index d2d7590cb1..4dc3188443 100644 --- a/code/modules/modular_computers/file_system/programs/secureye.dm +++ b/code/modules/modular_computers/file_system/programs/secureye.dm @@ -144,8 +144,8 @@ var/list/visible_turfs = list() - // Is this camera located in or attached to a living thing? If so, assume the camera's loc is the living thing. - var/cam_location = isliving(active_camera.loc) ? active_camera.loc : active_camera + // Need to get camera's location or it + var/cam_location = get_atom_on_turf(active_camera) // If we're not forcing an update for some reason and the cameras are in the same location, // we don't need to update anything.