Skip to content

Commit

Permalink
properly unregister from cameras
Browse files Browse the repository at this point in the history
  • Loading branch information
mullenpaul committed Dec 23, 2023
1 parent dec1a84 commit b3d5d28
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion code/game/camera_manager/camera_manager.dm
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,8 @@
cam_plane_masters = null
QDEL_NULL(cam_background)
QDEL_NULL(cam_screen)
if(current)
UnregisterSignal(current, COMSIG_PARENT_QDELETING)

/datum/component/camera_manager/proc/add_plane(atom/movable/screen/plane_master/instance)
instance.assigned_map = map_name
Expand Down Expand Up @@ -97,6 +99,8 @@
UnregisterSignal(parent, COMSIG_CAMERA_CLEAR)

/datum/component/camera_manager/proc/clear_camera()
if(current)
UnregisterSignal(current, COMSIG_PARENT_QDELETING)
current_area = null
current = null
target_x = null
Expand All @@ -113,7 +117,7 @@
current = target
target_width = w
target_height = h
RegisterSignal(current, COMSIG_PARENT_QDELETING, PROC_REF(show_camera_static), override = TRUE)
RegisterSignal(current, COMSIG_PARENT_QDELETING, PROC_REF(show_camera_static))
update_target_camera()

/datum/component/camera_manager/proc/set_camera_rect(source, x, y, z, w, h)
Expand Down

0 comments on commit b3d5d28

Please sign in to comment.