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

Fixes List<T>::insert_before/after #13143

Merged

Conversation

willnationsdev
Copy link
Contributor

A separate commit to serve as a base for #13116

@ghost ghost added this to the 3.0 milestone Nov 21, 2017
@akien-mga
Copy link
Member

Could you explain what this change does and what bug it solves?

@willnationsdev
Copy link
Contributor Author

willnationsdev commented Nov 21, 2017

@akien-mga Yes.

I encountered it towards the end of #10799 (with a code sample). Basically, if you use insert_before and then proceed to run a loop running from front() to back(), the chain from the preceding node into the new node is skipped, running directly to the original connection. This fixes it so that the preceding node now points to the newly inserted node, allowing for it to not be skipped. The same would hold true for loops running backwards after calling insert_after.

This may also require changes to nativescript.cpp as when I last ran a search, insert_before was getting called there as well. Whatever it was doing will now suddenly have a more complete connection, so we'll need to double check whether that changes any of the functionality (if it isn't retrieving the returned node and accessing it directly, for example).

@akien-mga akien-mga merged commit ba891a0 into godotengine:master Nov 22, 2017
@willnationsdev willnationsdev deleted the list-insert-before-after-fix branch February 3, 2018 03:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants