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

makes LZ detector work while landed round 2 #4647

Merged
merged 23 commits into from
Nov 2, 2023
Merged
Changes from all commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
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
44 changes: 21 additions & 23 deletions code/modules/cm_marines/dropship_equipment.dm
Original file line number Diff line number Diff line change
Expand Up @@ -508,42 +508,40 @@

/obj/structure/dropship_equipment/electronics/landing_zone_detector
name = "\improper AN/AVD-60 LZ detector"
desc = "An electronic device linked to the dropship's camera system that lets you observe your landing zone mid-flight."
desc = "An electronic device linked to the dropship's camera system that lets you observe your landing zone."
icon_state = "lz_detector"
point_cost = 50
var/obj/structure/machinery/computer/cameras/dropship/linked_cam_console
cuberound marked this conversation as resolved.
Show resolved Hide resolved

/obj/structure/dropship_equipment/electronics/landing_zone_detector/proc/connect_cameras() //searches for dropship_camera_console and connects with it
if(linked_cam_console)
return
var/obj/structure/machinery/computer/cameras/dropship/dropship_camera_console = locate() in range(5, loc)
linked_cam_console = dropship_camera_console
linked_cam_console.network.Add(CAMERA_NET_LANDING_ZONES)

/obj/structure/dropship_equipment/electronics/landing_zone_detector/proc/disconnect_cameras() //clears up vars and updates users
if(!linked_cam_console)
return
linked_cam_console.network.Remove(CAMERA_NET_LANDING_ZONES)
for(var/datum/weakref/ref as anything in linked_cam_console.concurrent_users)
var/mob/user = ref.resolve()
if(user)
linked_cam_console.update_static_data(user)
linked_cam_console = null

/obj/structure/dropship_equipment/electronics/landing_zone_detector/update_equipment()
if(ship_base)
if(!linked_cam_console)
for(var/obj/structure/machinery/computer/cameras/dropship/D in range(5, loc))
linked_cam_console = D
break
connect_cameras()
icon_state = "[initial(icon_state)]_installed"
else
linked_cam_console = null
disconnect_cameras()
icon_state = initial(icon_state)


/obj/structure/dropship_equipment/electronics/landing_zone_detector/Destroy()
linked_cam_console = null
disconnect_cameras()
return ..()

/obj/structure/dropship_equipment/electronics/landing_zone_detector/on_launch()
linked_cam_console.network.Add(CAMERA_NET_LANDING_ZONES) //only accessible while in the air.
for(var/datum/weakref/ref in linked_cam_console.concurrent_users)
var/mob/user = ref.resolve()
if(user)
linked_cam_console.update_static_data(user)

/obj/structure/dropship_equipment/electronics/landing_zone_detector/on_arrival()
linked_cam_console.network.Remove(CAMERA_NET_LANDING_ZONES)
for(var/datum/weakref/ref in linked_cam_console.concurrent_users)
var/mob/user = ref.resolve()
if(user)
linked_cam_console.update_static_data(user)


/////////////////////////////////// COMPUTERS //////////////////////////////////////

//unfinished and unused
Expand Down