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 #4516

Closed
wants to merge 0 commits into from

Conversation

cuberound
Copy link
Contributor

@cuberound cuberound commented Sep 26, 2023

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:

@github-actions github-actions bot added the Balance You need to be a professional veteran game maintainer to comprehend what is being done here. label Sep 26, 2023
Copy link
Member

@morrowwolf morrowwolf left a 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

@cuberound

This comment was marked as off-topic.

@morrowwolf morrowwolf marked this pull request as ready for review September 29, 2023 20:20
Copy link
Member

@morrowwolf morrowwolf left a 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)

@morrowwolf morrowwolf marked this pull request as draft October 2, 2023 11:53
Comment on lines 522 to 544
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)
Copy link

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

@cm13-github cm13-github added the Merge Conflict PR can't be merged because it touched too much code label Oct 7, 2023
@cm13-github
Copy link
Contributor

This pull request has conflicts, please resolve those before we can evaluate the pull request.

@Zonespace27 Zonespace27 added the Balance Approved This PR has had its balance and gameplay-affecting aspects approved. Cry to the Head-maint about it. label Oct 12, 2023
@cuberound cuberound closed this Oct 12, 2023
github-merge-queue bot pushed a commit that referenced this pull request Nov 2, 2023
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:
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Balance Approved This PR has had its balance and gameplay-affecting aspects approved. Cry to the Head-maint about it. Balance You need to be a professional veteran game maintainer to comprehend what is being done here. Merge Conflict PR can't be merged because it touched too much code
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants