-
Notifications
You must be signed in to change notification settings - Fork 616
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
roofs using queue instead of recursion #7945
base: master
Are you sure you want to change the base?
Conversation
code/game/objects/structures/roof.dm
Outdated
var/list/unprocesed_nodes = list() | ||
for(var/obj/effect/roof_node/node in location) | ||
node.link_master(src) | ||
unprocesed_nodes += node |
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.
Would be better to just figure out all the work that needs to be performed, and have that in a list. Likely better to add using |= so you don't add duplicates; but you may want to test what performs better w/ large use cases: as in is byond faster at checking for duplicates than just enqueueing them anyways and finding out we don't need to work on them when you come across a node already set up.
code/game/objects/structures/roof.dm
Outdated
for(var/obj/structure/roof/roof in location) | ||
roof.link_master(src) | ||
unprocesed_roofs += roof |
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.
Would be better to just figure out all the work that needs to be performed, and have that in a list. Likely better to add using |= so you don't add duplicates; but you may want to test what performs better w/ large use cases: as in is byond faster at checking for duplicates than just enqueueing them anyways and finding out we don't need to work on them when you come across a node already set up.
return | ||
master.connected_nodes += src | ||
linked_master = master | ||
var/list/nerby_nodes = list() | ||
for(var/direction in CARDINAL_ALL_DIRS) | ||
for(var/obj/effect/roof_node/node in get_step(src,direction)) | ||
node.link_master(master) | ||
if(!node.linked_master) | ||
nerby_nodes += node | ||
return nerby_nodes |
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.
This proc is likely moot to exist with suggested changes to connect.
This PR has been inactive for long enough to be automatically marked as stale. This means it is at risk of being auto closed in ~ 7 days, please address any outstanding review items and ensure your PR is finished, if these are all true and you are auto-staled anyway, you need to actively ask maintainers if your PR will be merged. Once you have done any of the previous actions then you should request a maintainer remove the stale label on your PR, to reset the stale timer. If you feel no maintainer will respond in that time, you may wish to close this PR youself, while you seek maintainer comment, as you will then be able to reopen the PR yourself |
About the pull request
dreammaker had recursion issues with big roofs, this might solve it using using queue
Explain why it's good for the game
allows for big roofs
Testing Photographs and Procedure
Screenshots & Videos
Put screenshots and videos here with an empty line between the screenshots and the
<details>
tags.Changelog
🆑
code: improves initialization of masternode for structure/roof
/:cl: