-
-
Notifications
You must be signed in to change notification settings - Fork 589
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
Implement index operators for Arrays #627
Conversation
Original PR on Vnens repo: vnen#23 note that we're still looking into why Variants are giving issues. |
|
@alessandrofama Long overdue to rebase, let me clean it up :) Was it working for you? I was having issues with the Variants themselves before but that may have been resolved by now. |
075c932
to
c2b6904
Compare
It was not working, but at least I could compile while working on other stuff :D While looking at the debugger, I noticed that the address of the returned godot-cpp/src/variant/packed_arrays.cpp Line 134 in c2b6904
Thought that was strange, so stepping through Godot's source, it seems to me that Array::operator[] is not being called before returning the void pointer here: Weirdly enough, calling the operator directly seems to have fixed the crashes for me:
Hobby dev here, so not sure why it would behave like this 🤔 (might be completely wrong here, have been a gdnative user for a while, but new to the source). |
That actually makes a lot of sense, what it is likely doing is taking &self first, which is a pointer to the self pointer, and then moving that pointer forward by index. So |
Once the fix in Godot is merged, we can merge this. Works like a charm now, thanks @alessandrofama ! |
@akien-mga with the fix in Godot merged, I think we can merge this too, unless we want people to verify if it works first? it worked for me so :) |
Thanks! |
Resubmit of GDExceptions array index operators