From b0d9c07946cd1e7e9559ff8dd7cc4c4c347fe585 Mon Sep 17 00:00:00 2001 From: NovaBot <154629622+NovaBot13@users.noreply.github.com> Date: Sat, 30 Mar 2024 19:15:27 -0400 Subject: [PATCH] [MIRROR] Makes simple bodycam component `COMPONENT_DUPE_SELECTIVE` (#1729) * Makes simple bodycam component `COMPONENT_DUPE_SELECTIVE` (#82310) ## About The Pull Request The thought only just occurred to me people may want to throw multiple bodycams with different networks on them onto one mob, and it would be trivially easy to support, so here. I used `COMPONENT_DUPE_SELECTIVE` rather than `COMPONENT_DUPE_ALLOWED` so people can avoid adding two of the same camera (network) to one mob. * Makes simple bodycam component `COMPONENT_DUPE_SELECTIVE` --------- Co-authored-by: MrMelbert <51863163+MrMelbert@users.noreply.github.com> --- code/datums/components/simple_bodycam.dm | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/code/datums/components/simple_bodycam.dm b/code/datums/components/simple_bodycam.dm index 2a6b0188972..81deb50649d 100644 --- a/code/datums/components/simple_bodycam.dm +++ b/code/datums/components/simple_bodycam.dm @@ -1,5 +1,6 @@ /// Simple component to integrate a bodycam into a mob /datum/component/simple_bodycam + dupe_mode = COMPONENT_DUPE_SELECTIVE /// The actual camera, in our mob's contents VAR_PRIVATE/obj/machinery/camera/bodycam /// How fast we update @@ -37,6 +38,17 @@ QDEL_NULL(bodycam) return ..() +/datum/component/simple_bodycam/CheckDupeComponent( + datum/component/simple_bodycam/new_bodycam, // will be null + camera_name, + c_tag, + network = "ss13", + emp_proof, + camera_update_time, +) + // Dupes are only allowed if we don't have a camera on that network already + return (network in bodycam.network) + /datum/component/simple_bodycam/proc/update_cam(datum/source, atom/old_loc, ...) SIGNAL_HANDLER