Skip to content

Commit f2050bb

Browse files
authored
Shuttle docker console camera eyes now refresh if the offset/range is VV'd. (#87620) (#4075)
## About The Pull Request If you VV the `x_offset`, `y_offset`, `view_range`, or `see_hidden` vars of a `/obj/machinery/computer/camera_advanced/shuttle_docker`, it will destroy the current eyeobj - if someone is currently viewing said shuttle console, it'll somewhat seemlessly "refresh" with the new range and offset for them. ## Why It's Good For The Game Makes it easier for mappers to get the correct offset and range for shuttle docker consoles. ## Changelog Not really any player-facing changes, this is meant to make it easier to figure out a good offset/view range when designing new shuttles.
1 parent b1d75b4 commit f2050bb

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

code/modules/shuttle/navigation_computer.dm

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,20 @@
6060
else
6161
QDEL_NULL(my_port)
6262

63+
/obj/machinery/computer/camera_advanced/shuttle_docker/vv_edit_var(vname, vval)
64+
. = ..()
65+
if(vname in list(NAMEOF(src, view_range), NAMEOF(src, x_offset), NAMEOF(src, y_offset), NAMEOF(src, see_hidden)))
66+
refresh_eye()
67+
68+
/// Destroys the eyeobj of this console, safely refreshing it if the console is currently being used.
69+
/obj/machinery/computer/camera_advanced/shuttle_docker/proc/refresh_eye()
70+
var/mob/living/user = current_user
71+
if(user)
72+
remove_eye_control(user)
73+
QDEL_NULL(eyeobj)
74+
if(user)
75+
attack_hand(user)
76+
6377
/// "Initializes" any default port ids we have, done so add_jumpable_port can be a proper setter
6478
/obj/machinery/computer/camera_advanced/shuttle_docker/proc/set_init_ports()
6579
var/list/init_ports = jump_to_ports.Copy()

0 commit comments

Comments
 (0)