-
Notifications
You must be signed in to change notification settings - Fork 522
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 #4516
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Needs to turn off the linked network when the LZ detector is taken off the ship
This comment was marked as off-topic.
This comment was marked as off-topic.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
update_equipment() is called more than just taking it on and off so when you're picking it up and such it will runtime as there's no linked_cam_console at line 529 after it goes into the else given ship_base is not set.
Secondly, I'd recommend early returns instead of else here so add a return at the end of the if(ship_base) block and then remove the else. (if you keep the current structure while fixing it)
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) | ||
icon_state = "[initial(icon_state)]_installed" | ||
else | ||
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) | ||
linked_cam_console = null | ||
icon_state = initial(icon_state) | ||
|
||
|
||
/obj/structure/dropship_equipment/electronics/landing_zone_detector/Destroy() | ||
if(linked_cam_console) | ||
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) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you got a lot of repeating code here, you can stuff a good portion of that into like a proc if ya really wanted.
/obj/structure/dropship_equipment/electronics/landing_zone_detector/update_cam_access(cam_access)
if(cam_access)
linked_cam_console.network.Add(CAMERA_NET_LANDING_ZONES)
else
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)
call it like update_cam_access(insert boolean here)
Or something similar
This pull request has conflicts, please resolve those before we can evaluate the pull request. |
d9cc1e3
to
d9250db
Compare
remade some stuff from #4516 to clean up the code, rest is the same. did not get to test it also not shure if I solved the mergeconflict properly if not tell me what is wrong :cl: balance: LZ detector now works even when the DS is stationary /:cl:
About the pull request
This PR makes it so that LZ detector works all the time not only when in air.
Explain why it's good for the game
The fact that LZ detector worked only when in air made it near useless, when you are already headed for the LZ what good is it to see it overrun and how is seeing xeno in FOB after you leave it any good. This turns LZ detector into a tool for transport pilot to better evaluate the situation in FOB before taking off from it or heading to it.
Changelog
🆑
balance: LZ detector now works even when the DS is stationary
/:cl: