Skip to content

Commit

Permalink
[MIRROR] Makes simple bodycam component COMPONENT_DUPE_SELECTIVE (#…
Browse files Browse the repository at this point in the history
…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 <[email protected]>
  • Loading branch information
2 people authored and StealsThePRs committed Mar 30, 2024
1 parent ea7fe01 commit b0d9c07
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions code/datums/components/simple_bodycam.dm
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -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

Expand Down

0 comments on commit b0d9c07

Please sign in to comment.