Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

reset CAS direct camera on change to avoid duplicated signal handlers #4755

Merged
merged 1 commit into from
Oct 26, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 9 additions & 2 deletions code/game/machinery/computer/dropship_weapons.dm
Original file line number Diff line number Diff line change
Expand Up @@ -594,14 +594,21 @@
return

var/targ_id = text2num(href_list["cas_camera"])

var/datum/cas_signal/new_signal
for(var/datum/cas_signal/LT as anything in cas_group.cas_signals)
if(LT.target_id == targ_id && LT.valid_signal())
selected_cas_signal = LT
new_signal = LT
break

if(!selected_cas_signal)
if(!new_signal)
to_chat(usr, SPAN_WARNING("Target lost or obstructed."))
return

if(usr in selected_cas_signal?.linked_cam?.viewing_users) // Reset previous cam
remove_from_view(usr)

selected_cas_signal = new_signal
if(selected_cas_signal && selected_cas_signal.linked_cam)
selected_cas_signal.linked_cam.view_directly(usr)
else
Expand Down
Loading